Skip to content

Commit

Permalink
Merge tag 'fixes-2024-01-28' 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 crash when reserved memory is not added to memory.

  When CONFIG_DEFERRED_STRUCT_PAGE_INIT is enabled, the initialization
  of reserved pages may cause access of NODE_DATA() with invalid nid and
  crash.

  Add a fall back to early_pfn_to_nid() in memmap_init_reserved_pages()
  to ensure a valid node id is always passed to init_reserved_page()"

* tag 'fixes-2024-01-28' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock:
  memblock: fix crash when reserved memory is not added to memory
  • Loading branch information
torvalds committed Jan 28, 2024
2 parents 8a696a2 + 6a9531c commit a08ebda
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mm/memblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -2176,6 +2176,9 @@ static void __init memmap_init_reserved_pages(void)
start = region->base;
end = start + region->size;

if (nid == NUMA_NO_NODE || nid >= MAX_NUMNODES)
nid = early_pfn_to_nid(PFN_DOWN(start));

reserve_bootmem_region(start, end, nid);
}
}
Expand Down

0 comments on commit a08ebda

Please sign in to comment.