summaryrefslogtreecommitdiff
path: root/mm/memblock.c
diff options
context:
space:
mode:
authorShiraz Hashim <shashim@codeaurora.org>2016-01-19 15:11:10 +0530
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 21:18:18 -0700
commit38a6f0388b1ef3abb157bf1e8ec3a9661605cc3d (patch)
treed150b95d09892844b68c10afdbebe9d44aa9c8ee /mm/memblock.c
parent91742a04a3a80449568051564bd452006e42c72c (diff)
mm/memblock: call kmemleak only for logically mapped region
On 32bit, memblock_alloc_range_nid can return block of memory from highmem. Ensure kmemleak is called only for logically mapped region. Change-Id: I4491f199437d8401071ba5f98a8b0eedbaf47b00 Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
Diffstat (limited to 'mm/memblock.c')
-rw-r--r--mm/memblock.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/memblock.c b/mm/memblock.c
index 02ad643a4898..04480ee049aa 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -734,7 +734,8 @@ int __init_memblock memblock_free(phys_addr_t base, phys_addr_t size)
(unsigned long long)base + size - 1,
(void *)_RET_IP_);
- kmemleak_free_part(__va(base), size);
+ if (base < memblock.current_limit)
+ kmemleak_free_part(__va(base), size);
return memblock_remove_range(&memblock.reserved, base, size);
}
@@ -1151,7 +1152,8 @@ static phys_addr_t __init memblock_alloc_range_nid(phys_addr_t size,
* The min_count is set to 0 so that memblock allocations are
* never reported as leaks.
*/
- kmemleak_alloc(__va(found), size, 0, 0);
+ if (found < memblock.current_limit)
+ kmemleak_alloc(__va(found), size, 0, 0);
return found;
}
return 0;