Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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: