ARM: 8551/2: DMA: Fix kzalloc flags in __dma_alloc
commit9c18fcf7ae0ef87f0723dfd74c27d608c7486e0e
authorAlexandre Courbot <acourbot@nvidia.com>
Wed, 13 Apr 2016 04:55:29 +0000 (13 05:55 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 15 Apr 2016 08:44:02 +0000 (15 09:44 +0100)
tree47e37ee905185e4b0021843cb7b1b2e483a035ce
parent208fae5c3b9431013ad7bcea07cbcee114e7d163
ARM: 8551/2: DMA: Fix kzalloc flags in __dma_alloc

Commit 19e6e5e5392b ("ARM: 8547/1: dma-mapping: store buffer
information") allocates a structure meant for internal buffer management
with the GFP flags of the buffer itself. This can trigger the following
safeguard in the slab/slub allocator:

if (unlikely(flags & GFP_SLAB_BUG_MASK)) {
pr_emerg("gfp: %un", flags & GFP_SLAB_BUG_MASK);
BUG();
}

Fix this by filtering the flags that make the slab allocator unhappy.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Acked-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mm/dma-mapping.c