Skip to content

Commit

Permalink
x86: don't do dma if mask is NULL.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Glauber Costa authored and Ingo Molnar committed Apr 19, 2008
1 parent da60cab commit bb8ada9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/x86/kernel/pci-dma_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit bb8ada9

Please sign in to comment.