slab: Return NULL for oversized allocations
authorChristoph Lameter <[email protected]>
Fri, 3 May 2013 15:43:18 +0000 (15:43 +0000)
committerPekka Enberg <[email protected]>
Mon, 6 May 2013 06:24:16 +0000 (09:24 +0300)
commit6286ae97d10ea2b5cd90532163797ab217bfdbdf
tree0724efb47d735ce835709d2402de02de4dd61f07
parent14e50c6a9bc2b283bb4021026226268312ceefdd
slab: Return NULL for oversized allocations

The inline path seems to have changed the SLAB behavior for very large
kmalloc allocations with  commit e3366016 ("slab: Use common
kmalloc_index/kmalloc_size functions"). This patch restores the old
behavior but also adds diagnostics so that we can figure where in the
code these large allocations occur.

Reported-and-tested-by: Tetsuo Handa <[email protected]>
Signed-off-by: Christoph Lameter <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
[email protected]: use WARN_ON_ONCE ]
Signed-off-by: Pekka Enberg <[email protected]>
include/linux/slab_def.h
mm/slab_common.c