[FIX] patch "SLUB: Get rid of dynamic DMA kmalloc cacheallocation"

From: Christoph Lameter
Date: Tue Oct 13 2009 - 14:57:40 EST


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@xxxxxxxxxxxxxxxxxxxx>

---
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);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/