summaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2012-06-14 14:01:30 +0200
committerHiroshi Doyu <hdoyu@nvidia.com>2012-09-07 11:46:09 +0300
commit508de08ce897f2bf7bd0684b19ae94c3a5f190b9 (patch)
tree19a60d48711cdbc8ae4b53c9acd0f300760c9d78 /arch/x86
parent34f4c96bcd47d210ef055003d21b3ae3aadee9d9 (diff)
x86: dma-mapping: fix broken allocation when dma_mask has been provided
Commit 0a2b9a6ea93 ("X86: integrate CMA with DMA-mapping subsystem") broke memory allocation with dma_mask. This patch fixes possible kernel ops caused by lack of resetting page variable when jumping to 'again' label. Reported-by: Konrad Rzeszutek Wilk <konrad@darnok.org> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Acked-by: Michal Nazarewicz <mina86@mina86.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/pci-dma.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
index 62c9457ccd2f..c0f420f76cd3 100644
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -100,7 +100,7 @@ void *dma_generic_alloc_coherent(struct device *dev, size_t size,
struct dma_attrs *attrs)
{
unsigned long dma_mask;
- struct page *page = NULL;
+ struct page *page;
unsigned int count = PAGE_ALIGN(size) >> PAGE_SHIFT;
dma_addr_t addr;
@@ -108,6 +108,7 @@ void *dma_generic_alloc_coherent(struct device *dev, size_t size,
flag |= __GFP_ZERO;
again:
+ page = NULL;
if (!(flag & GFP_ATOMIC))
page = dma_alloc_from_contiguous(dev, count, get_order(size));
if (!page)