diff options
author | Mark Brown <broonie@linaro.org> | 2014-07-18 11:14:23 +0100 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-07-18 11:14:23 +0100 |
commit | 8e8420b5bc8de83907f7473c239b6a2472f493b9 (patch) | |
tree | 83fed3c6bfa35d5e42736173c34b52d2853871be /drivers/base | |
parent | 2dad499c5077c61220a1dade05a27d15e306a4dc (diff) | |
parent | 3d3d802f6958dfd2c12e65e88a5c2ec9b5486c1a (diff) |
Merge branch 'linux-linaro-lsk-v3.14' into linux-linaro-lsk-v3.14-android
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/dma-contiguous.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c index 165c2c299e57..d3bffa478eca 100644 --- a/drivers/base/dma-contiguous.c +++ b/drivers/base/dma-contiguous.c @@ -155,13 +155,23 @@ 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); return 0; + +err: + kfree(cma->bitmap); + return -EINVAL; } static struct cma cma_areas[MAX_CMA_AREAS]; |