lkml.org 
[lkml]   [2009]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 1/2] 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: 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];

\
 
 \ /
  Last update: 2009-02-03 14:59    [W:0.148 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site