Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cb3a9220 authored by Shiraz Hashim's avatar Shiraz Hashim Committed by Patrick Daly
Browse files

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: default avatarShiraz Hashim <shashim@codeaurora.org>
Signed-off-by: default avatarPatrick Daly <pdaly@codeaurora.org>
parent b982b6dc
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -723,6 +723,7 @@ int __init_memblock memblock_free(phys_addr_t base, phys_addr_t size)
		     (unsigned long long)base + size - 1,
		     (void *)_RET_IP_);

	if (base < memblock.current_limit)
		kmemleak_free_part(__va(base), size);
	return memblock_remove_range(&memblock.reserved, base, size);
}
@@ -1152,6 +1153,7 @@ 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.
		 */
		if (found < memblock.current_limit)
			kmemleak_alloc(__va(found), size, 0, 0);
		return found;
	}