From 7c309a64d6afa90a0a07813c836ba480aeaeca8c Mon Sep 17 00:00:00 2001 From: Christian Krafft Date: Wed, 6 Dec 2006 20:32:41 -0800 Subject: [PATCH] [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 Cc: Christoph Lameter Cc: Andy Whitcroft Cc: Martin Bligh Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/bootmem.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mm/bootmem.c b/mm/bootmem.c index d53112fcb4..94253428f0 100644 --- a/mm/bootmem.c +++ b/mm/bootmem.c @@ -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) -- 2.39.5