]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ARM: dma-mapping: fix GFP_ATOMIC macro usage
authorMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 16 Jan 2014 14:39:17 +0000 (15:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Mar 2014 06:06:07 +0000 (22:06 -0800)
commit 10c8562f932d89c030083e15f9279971ed637136 upstream.

GFP_ATOMIC is not a single gfp flag, but a macro which expands to the other
flags and LACK of __GFP_WAIT flag. To check if caller wanted to perform an
atomic allocation, the code must test __GFP_WAIT flag presence. This patch
fixes the issue introduced in v3.6-rc5

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/mm/dma-mapping.c

index f61a5707823a40e0af9474d4f18809f9196b1264..5fe4d72705d8dd30b4fcd76e38a306ed1550ba1e 100644 (file)
@@ -1358,7 +1358,7 @@ static void *arm_iommu_alloc_attrs(struct device *dev, size_t size,
        *handle = DMA_ERROR_CODE;
        size = PAGE_ALIGN(size);
 
-       if (gfp & GFP_ATOMIC)
+       if (!(gfp & __GFP_WAIT))
                return __iommu_alloc_atomic(dev, size, handle);
 
        /*