Skip to content

Commit

Permalink
Merge tag 'fixes-2021-10-16' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/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
  • Loading branch information
Linus Torvalds committed Oct 16, 2021
2 parents 368a978 + 6e44bd6 commit ccfb5ce
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mm/memblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit ccfb5ce

Please sign in to comment.