Messages in this thread | | | Date | Wed, 25 Jun 2014 21:17:51 -0400 | From | Theodore Ts'o <> | Subject | Re: [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
| |