summaryrefslogtreecommitdiffstats
path: root/drivers/base/dma-contiguous.c
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2014-07-20 23:59:16 -0700
committerBrian Norris <computersforpeace@gmail.com>2014-07-21 00:01:16 -0700
commitd0d5864676dbccfb1337864a0ae6ce97e6342678 (patch)
tree7caa674ec05a1797054cd4304f0a047b6dacddd6 /drivers/base/dma-contiguous.c
parent6534e6809e6c9d48114b537afe03bee3fd33bf01 (diff)
parent9a3c4145af32125c5ee39c0272662b47307a8323 (diff)
downloadop-kernel-dev-d0d5864676dbccfb1337864a0ae6ce97e6342678.zip
op-kernel-dev-d0d5864676dbccfb1337864a0ae6ce97e6342678.tar.gz
Merge tag 'v3.16-rc6' into MTD development branch
Linux 3.16-rc6
Diffstat (limited to 'drivers/base/dma-contiguous.c')
-rw-r--r--drivers/base/dma-contiguous.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c
index 83969f8..6467c91 100644
--- a/drivers/base/dma-contiguous.c
+++ b/drivers/base/dma-contiguous.c
@@ -176,14 +176,24 @@ static int __init cma_activate_area(struct cma *cma)
base_pfn = pfn;
for (j = pageblock_nr_pages; j; --j, pfn++) {
WARN_ON_ONCE(!pfn_valid(pfn));
+ /*
+ * alloc_contig_range requires the pfn range
+ * specified to be in the same zone. Make this
+ * simple by forcing the entire CMA resv range
+ * to be in the same zone.
+ */
if (page_zone(pfn_to_page(pfn)) != zone)
- return -EINVAL;
+ goto err;
}
init_cma_reserved_pageblock(pfn_to_page(base_pfn));
} while (--i);
mutex_init(&cma->lock);
return 0;
+
+err:
+ kfree(cma->bitmap);
+ return -EINVAL;
}
static struct cma cma_areas[MAX_CMA_AREAS];
OpenPOWER on IntegriCloud