lkml.org 
[lkml]   [2009]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[FIX] patch "SLUB: Get rid of dynamic DMA kmalloc cache allocation"
Slight bug when creating kmalloc dma caches on the fly. When searching for
an unused statically allocated kmem_cache structure we need to check for
size == 0 not the other way around.

Signed-off-by: Christoph Lameter <cl@linux-foundation.org>

---
mm/slub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/mm/slub.c
===================================================================
--- linux-2.6.orig/mm/slub.c 2009-10-13 13:31:05.000000000 -0500
+++ linux-2.6/mm/slub.c 2009-10-13 13:31:36.000000000 -0500
@@ -2650,7 +2650,7 @@ static noinline struct kmem_cache *dma_k

s = NULL;
for (i = 0; i < KMALLOC_CACHES; i++)
- if (kmalloc_caches[i].size)
+ if (!kmalloc_caches[i].size)
break;

BUG_ON(i >= KMALLOC_CACHES);


\
 
 \ /
  Last update: 2009-10-13 21:11    [W:0.366 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site