lkml.org 
[lkml]   [2014]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] FS/JBD:replace count*size kmalloc by kmalloc_array
On Wed, Jun 25, 2014 at 08:49:06PM +0200, Fabian Frederick wrote:
> kmalloc_array manages count*sizeof overflow.

Except in these call sites, overflow is impossible.

kmalloc_array() is useful when count is coming from an unvalidated
source. But in this case, the count is either a fixed, hard-coded
value (256), or the size of n*count is *guaranteed* to be less than
the page size.

So this just adds some extra code which is pointless (assuming the
compiler isn't smart enough to optimize it out).

- Ted


\
 
 \ /
  Last update: 2014-06-26 03:41    [W:0.034 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site