aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorGlauber Costa <gcosta@redhat.com>2008-04-09 12:18:09 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-19 13:19:58 -0400
commitbb8ada95a7c11adf3dad4e8d5c55ef1650560592 (patch)
tree3cf1e92ccb67dfef98a7f2660faaf097086d2cd0 /arch/x86
parentda60cab4dd922cd933e82bace490f6155a32a90e (diff)
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>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/pci-dma_32.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kernel/pci-dma_32.c b/arch/x86/kernel/pci-dma_32.c
index f134de3833a2..d2f70744a93a 100644
--- a/arch/x86/kernel/pci-dma_32.c
+++ b/arch/x86/kernel/pci-dma_32.c
@@ -91,6 +91,9 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
91 if (dma_mask == 0) 91 if (dma_mask == 0)
92 dma_mask = DMA_32BIT_MASK; 92 dma_mask = DMA_32BIT_MASK;
93 93
94 if (dev->dma_mask == NULL)
95 return NULL;
96
94 /* Don't invoke OOM killer */ 97 /* Don't invoke OOM killer */
95 gfp |= __GFP_NORETRY; 98 gfp |= __GFP_NORETRY;
96again: 99again: