From b1e0541674904db00e17ce646b0a1d54f59136a5 Mon Sep 17 00:00:00 2001 From: Joonsoo Kim Date: Mon, 4 Feb 2013 23:46:46 +0900 Subject: [PATCH] mm/sl[au]b: correct allocation type check in kmalloc_slab() commit "slab: Common Kmalloc cache determination" made mistake in kmalloc_slab(). SLAB_CACHE_DMA is for kmem_cache creation, not for allocation. For allocation, we should use GFP_XXX to identify type of allocation. So, change SLAB_CACHE_DMA to GFP_DMA. Acked-by: Christoph Lameter Reported-by: Fengguang Wu Signed-off-by: Joonsoo Kim Signed-off-by: Pekka Enberg --- mm/slab_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/slab_common.c b/mm/slab_common.c index 6d73f0b7f21c..2f0e7d5976cb 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -382,7 +382,7 @@ struct kmem_cache *kmalloc_slab(size_t size, gfp_t flags) index = fls(size - 1); #ifdef CONFIG_ZONE_DMA - if (unlikely((flags & SLAB_CACHE_DMA))) + if (unlikely((flags & GFP_DMA))) return kmalloc_dma_caches[index]; #endif -- 2.20.1