Commit d895335b authored by Nick Piggin's avatar Nick Piggin Committed by Pekka Enberg

slqb: fix small zero size alloc bug

Fix a problem where SLQB did not correctly return ZERO_SIZE_PTR for a
zero sized allocation.
Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
Signed-off-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
parent 6d084197
......@@ -237,7 +237,7 @@ static __always_inline struct kmem_cache *kmalloc_slab(size_t size, gfp_t flags)
index = kmalloc_index(size);
if (unlikely(index == 0))
return NULL;
return ZERO_SIZE_PTR;
if (likely(!(flags & SLQB_DMA)))
return &kmalloc_caches[index];
......
Markdown is supported
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