Commit 0b44f7a5 authored by Christoph Lameter's avatar Christoph Lameter Committed by Linus Torvalds
Browse files

slab: warn on zero-length allocations

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
Signed-off-by: default avatarChristoph Lameter <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 4b6f0750
......@@ -789,6 +789,7 @@ static inline struct kmem_cache *__find_general_cachep(size_t size,
BUG_ON(malloc_sizes[INDEX_AC].cs_cachep == NULL);
WARN_ON_ONCE(size == 0);
while (size > csizep->cs_size)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment