Commit bb8ada95 authored by Glauber Costa's avatar Glauber Costa Committed by Ingo Molnar

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: default avatarGlauber Costa <gcosta@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent da60cab4
...@@ -91,6 +91,9 @@ void *dma_alloc_coherent(struct device *dev, size_t size, ...@@ -91,6 +91,9 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
if (dma_mask == 0) if (dma_mask == 0)
dma_mask = DMA_32BIT_MASK; dma_mask = DMA_32BIT_MASK;
if (dev->dma_mask == NULL)
return NULL;
/* Don't invoke OOM killer */ /* Don't invoke OOM killer */
gfp |= __GFP_NORETRY; gfp |= __GFP_NORETRY;
again: again:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment