提交 bb8ada95 编写于 作者: G Glauber Costa 提交者: 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: NGlauber Costa <gcosta@redhat.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
上级 da60cab4
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册