]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
x86: don't do dma if mask is NULL.
authorGlauber Costa <gcosta@redhat.com>
Wed, 9 Apr 2008 16:18:09 +0000 (13:18 -0300)
committerIngo Molnar <mingo@elte.hu>
Sat, 19 Apr 2008 17:19:58 +0000 (19:19 +0200)
if the device hasn't provided a mask, abort allocation.
Note that we're using a fallback device now, so it does not cover
the case of a NULL device: just drivers passing NULL masks around.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kernel/pci-dma_32.c

index f134de3833a2552c1e0a6fa0a31fe477aaa4cb94..d2f70744a93a42f985089d8eae699e57f650d115 100644 (file)
@@ -91,6 +91,9 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
        if (dma_mask == 0)
                dma_mask = DMA_32BIT_MASK;
 
+       if (dev->dma_mask == NULL)
+               return NULL;
+
        /* Don't invoke OOM killer */
        gfp |= __GFP_NORETRY;
 again: