[lkml]   [2018]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] fscache: fscache_set_key() - align alloc and usage
Tomas Bortoli <> wrote:

> The fscache_set_key() function allocates the buf pointer if index_key_len >
> sizeof(cookie->inline_key). In such cases the allocated space might not be
> aligned with the pointer type. This may result in an out-of-bound in the
> for-loop later in the same function, as the counter is rounded up.

Yeah, it's good idea anyway since I should tell the allocator everything that
I expect to use - though kmalloc() will effectively rounds up the size to a
multiple of 8 anyway (ie. the smallest allocation granule is 8 bytes).


 \ /
  Last update: 2018-08-03 15:50    [W:0.056 / U:0.824 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site