diff options
author | Alex Shi <alex.shi@linaro.org> | 2014-07-18 19:30:25 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2014-07-18 19:30:25 +0800 |
commit | 61f07d458105a68006684d5b4a7d5f1fe08e4ab9 (patch) | |
tree | 649b87c0379bbefa6842f53bf93af6e4eba2e531 /drivers/base | |
parent | db1df56deb8da9502679fb6965846c5c3ebca3a5 (diff) | |
parent | bc1f55ec195d03cac31e7221655cfc5d4a048284 (diff) |
Merge tag '3.14.13' into linux-linaro-lsk-v3.14
This is 3.14.13 stable release.
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]; |