Skip to contentSkip to conversation

mm/slab.c: check kmalloc() return value.

PATCH New Amit Choudhary 1 participant 1 message Mar 9, 2007 Memory management

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/slab.c: check kmalloc() return value.

Description: Check the return value of kmalloc() in function setup_cpu_cache(), in file mm/slab.c.

mm/slab.c +1 -0
index 84c631f..613ae61 100644
@@ -2021,6 +2021,7 @@ static int setup_cpu_cache(struct kmem_c
 	} else {
 		cachep->array[smp_processor_id()] =
 			kmalloc(sizeof(struct arraycache_init), GFP_KERNEL);
+		BUG_ON(!cachep->array[smp_processor_id()]);
 
 		if (g_cpucache_up == PARTIAL_AC) {
 			set_up_list3s(cachep, SIZE_L3);