diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2021-10-16 10:57:13 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2021-10-16 10:57:13 -0700 |
commit | ccfb5ceb400720969d6118c740c2fc37bcf990b8 (patch) | |
tree | 8197d7af2f061b4ef3386948cb4566b8f4959306 | |
parent | 368a978cc52ad14f90bd04a7d94ec0070da3e1c1 (diff) | |
parent | 6e44bd6d34d659c44cd8e7fc925c8a97f49b3c33 (diff) |
Merge tag 'fixes-2021-10-16' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock
Pull memblock fix from Mike Rapoport:
"Fix handling of NOMAP regions with kmemleak.
NOMAP regions don't have linear map entries so an attempt to scan
these areas in kmemleak would fault.
Prevent such faults by excluding NOMAP regions from kmemleak"
* tag 'fixes-2021-10-16' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock:
memblock: exclude NOMAP regions from kmemleak
-rw-r--r-- | mm/memblock.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mm/memblock.c b/mm/memblock.c index 184dcd2e5d99..5c3503c98b2f 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -936,7 +936,12 @@ int __init_memblock memblock_mark_mirror(phys_addr_t base, phys_addr_t size) */ int __init_memblock memblock_mark_nomap(phys_addr_t base, phys_addr_t size) { - return memblock_setclr_flag(base, size, 1, MEMBLOCK_NOMAP); + int ret = memblock_setclr_flag(base, size, 1, MEMBLOCK_NOMAP); + + if (!ret) + kmemleak_free_part_phys(base, size); + + return ret; } /** |