mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
[PATCH] enable booting a NUMA system where some nodes have no memory
When booting a NUMA system with nodes that have no memory (eg by limiting memory), bootmem_alloc_core tried to find pages in an uninitialized bootmem_map. This caused a null pointer access. This fix adds a check, so that NULL is returned. That will enable the caller (bootmem_alloc_nopanic) to alloc memory on other without a panic. Signed-off-by: Christian Krafft <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Andy Whitcroft <[email protected]> Cc: Martin Bligh <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
a120586873
commit
7c309a64d6
1 changed files with 4 additions and 0 deletions
|
|
@ -196,6 +196,10 @@ __alloc_bootmem_core(struct bootmem_data *bdata, unsigned long size,
|
|||
if (limit && bdata->node_boot_start >= limit)
|
||||
return NULL;
|
||||
|
||||
/* on nodes without memory - bootmem_map is NULL */
|
||||
if (!bdata->node_bootmem_map)
|
||||
return NULL;
|
||||
|
||||
end_pfn = bdata->node_low_pfn;
|
||||
limit = PFN_DOWN(limit);
|
||||
if (limit && end_pfn > limit)
|
||||
|
|
|
|||
Loading…
Reference in a new issue