x86: don't do dma if mask is NULL.

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>
This commit is contained in:
Glauber Costa 2008-04-09 13:18:09 -03:00 committed by Ingo Molnar
parent da60cab4dd
commit bb8ada95a7
1 changed files with 3 additions and 0 deletions

View 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: