diff options
author | Christian Krafft <krafft@de.ibm.com> | 2006-12-06 23:32:41 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:22 -0500 |
commit | 7c309a64d6afa90a0a07813c836ba480aeaeca8c (patch) | |
tree | a56b235fa35c2e528752071df2a6e21a25a4e8f6 /mm/bootmem.c | |
parent | a120586873d3d64de93bd6d593d237e131994e58 (diff) |
[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 <krafft@de.ibm.com>
Cc: Christoph Lameter <clameter@engr.sgi.com>
Cc: Andy Whitcroft <apw@shadowen.org>
Cc: Martin Bligh <mbligh@google.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/bootmem.c')
-rw-r--r-- | mm/bootmem.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mm/bootmem.c b/mm/bootmem.c index d53112fcb404..94253428f091 100644 --- a/mm/bootmem.c +++ b/mm/bootmem.c | |||
@@ -196,6 +196,10 @@ __alloc_bootmem_core(struct bootmem_data *bdata, unsigned long size, | |||
196 | if (limit && bdata->node_boot_start >= limit) | 196 | if (limit && bdata->node_boot_start >= limit) |
197 | return NULL; | 197 | return NULL; |
198 | 198 | ||
199 | /* on nodes without memory - bootmem_map is NULL */ | ||
200 | if (!bdata->node_bootmem_map) | ||
201 | return NULL; | ||
202 | |||
199 | end_pfn = bdata->node_low_pfn; | 203 | end_pfn = bdata->node_low_pfn; |
200 | limit = PFN_DOWN(limit); | 204 | limit = PFN_DOWN(limit); |
201 | if (limit && end_pfn > limit) | 205 | if (limit && end_pfn > limit) |