mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
mm: kmemleak: avoid using __va() on addresses that don't have a lowmem mapping
Some of the kmemleak_*() callbacks in memblock, bootmem, CMA convert a physical address to a virtual one using __va(). However, such physical addresses may sometimes be located in highmem and using __va() is incorrect, leading to inconsistent object tracking in kmemleak. The following functions have been added to the kmemleak API and they take a physical address as the object pointer. They only perform the corresponding action if the address has a lowmem mapping: kmemleak_alloc_phys kmemleak_free_part_phys kmemleak_not_leak_phys kmemleak_ignore_phys The affected calling places have been updated to use the new kmemleak API. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]> Reported-by: Vignesh R <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
0549a3c02e
commit
9099daed9c
7 changed files with 83 additions and 9 deletions
2
mm/cma.c
2
mm/cma.c
|
|
@ -336,7 +336,7 @@ int __init cma_declare_contiguous(phys_addr_t base,
|
|||
* kmemleak scans/reads tracked objects for pointers to other
|
||||
* objects but this address isn't mapped and accessible
|
||||
*/
|
||||
kmemleak_ignore(phys_to_virt(addr));
|
||||
kmemleak_ignore_phys(addr);
|
||||
base = addr;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue