linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [patch 1/2] slqb: fix small zero size alloc bug
@ 2009-02-03 13:55 Nick Piggin
  2009-02-03 14:07 ` [patch 2/2] slqb: dynamic array allocations Nick Piggin
  2009-02-03 14:24 ` [patch 1/2] slqb: fix small zero size alloc bug Pekka Enberg
  0 siblings, 2 replies; 4+ messages in thread
From: Nick Piggin @ 2009-02-03 13:55 UTC (permalink / raw)
  To: Pekka Enberg, Linux Memory Management List, Linux Kernel Mailing List


Fix a problem where SLQB did not correctly return ZERO_SIZE_PTR for a
zero sized allocation.

Signed-off-by: Nick Piggin <npiggin@suse.de>

---
 include/linux/slqb_def.h |    2 +-
 mm/slqb.c                |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6/include/linux/slqb_def.h
===================================================================
--- linux-2.6.orig/include/linux/slqb_def.h
+++ linux-2.6/include/linux/slqb_def.h
@@ -237,7 +237,7 @@ static __always_inline struct kmem_cache
 
 	index = kmalloc_index(size);
 	if (unlikely(index == 0))
-		return NULL;
+		return ZERO_SIZE_PTR;
 
 	if (likely(!(flags & SLQB_DMA)))
 		return &kmalloc_caches[index];

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-02-03 14:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-03 13:55 [patch 1/2] slqb: fix small zero size alloc bug Nick Piggin
2009-02-03 14:07 ` [patch 2/2] slqb: dynamic array allocations Nick Piggin
2009-02-03 14:27   ` Pekka Enberg
2009-02-03 14:24 ` [patch 1/2] slqb: fix small zero size alloc bug Pekka Enberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox