summaryrefslogtreecommitdiff
path: root/mm/cma.c
diff options
context:
space:
mode:
authorShiraz Hashim <shashim@codeaurora.org>2016-02-15 16:26:37 +0530
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 21:20:39 -0700
commit8cda11332431479d5f52e1527e5bce3e379f2443 (patch)
tree1a9675e4a2d1415069519b7fa012c4304c2b1852 /mm/cma.c
parent649bc1242cc2c9bbc71c147b40b51b2c25e97b75 (diff)
drivers: dma-contiguous: remove cma regions from kmemleak scan
cma regions can be allocated for secure use cases where the virtual mapping is removed. kmemleak scan can try to scan through this mapping causing mmu faults. Hence free cma regions from kmemleak scan. Change-Id: I2cc66423ec9ec539905cc8d07bbc40fa43e695bd Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
Diffstat (limited to 'mm/cma.c')
-rw-r--r--mm/cma.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/mm/cma.c b/mm/cma.c
index db890ac50cbd..cb2987bbb1e6 100644
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -134,6 +134,10 @@ static int __init cma_activate_area(struct cma *cma)
spin_lock_init(&cma->mem_head_lock);
#endif
+ if (!PageHighMem(pfn_to_page(cma->base_pfn)))
+ kmemleak_free_part(__va(cma->base_pfn << PAGE_SHIFT),
+ cma->count << PAGE_SHIFT);
+
return 0;
err: