Skip to content

Commit

Permalink
mm/sl[au]b: correct allocation type check in kmalloc_slab()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reported-by: Fengguang Wu <[email protected]>
Signed-off-by: Joonsoo Kim <[email protected]>
Signed-off-by: Pekka Enberg <[email protected]>
  • Loading branch information
JoonsooKim authored and penberg committed Feb 6, 2013
1 parent db84506 commit b1e0541
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/slab_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b1e0541

Please sign in to comment.