From: Christoph Lameter slub warns on this, and we're working on making kmalloc(0) return NULL. Let's make slab warn as well so our testers detect such callers more rapidly. Signed-off-by: Christoph Lameter Signed-off-by: Andrew Morton --- mm/slab.c | 1 + 1 files changed, 1 insertion(+) diff -puN mm/slab.c~slab-warn-on-zero-length-allocations mm/slab.c --- a/mm/slab.c~slab-warn-on-zero-length-allocations +++ a/mm/slab.c @@ -789,6 +789,7 @@ static inline struct kmem_cache *__find_ */ BUG_ON(malloc_sizes[INDEX_AC].cs_cachep == NULL); #endif + WARN_ON_ONCE(size == 0); while (size > csizep->cs_size) csizep++; _