diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/nobootmem.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/mm/nobootmem.c b/mm/nobootmem.c index 1983fb1c7026..cca76207e61a 100644 --- a/mm/nobootmem.c +++ b/mm/nobootmem.c | |||
@@ -305,11 +305,17 @@ again: | |||
305 | 305 | ||
306 | ptr = __alloc_memory_core_early(MAX_NUMNODES, size, align, | 306 | ptr = __alloc_memory_core_early(MAX_NUMNODES, size, align, |
307 | goal, -1ULL); | 307 | goal, -1ULL); |
308 | if (!ptr && goal) { | 308 | if (ptr) |
309 | return ptr; | ||
310 | |||
311 | if (goal) { | ||
309 | goal = 0; | 312 | goal = 0; |
310 | goto again; | 313 | goto again; |
311 | } | 314 | } |
312 | return ptr; | 315 | |
316 | printk(KERN_ALERT "bootmem alloc of %lu bytes failed!\n", size); | ||
317 | panic("Out of memory"); | ||
318 | return NULL; | ||
313 | } | 319 | } |
314 | 320 | ||
315 | void * __init __alloc_bootmem_node_high(pg_data_t *pgdat, unsigned long size, | 321 | void * __init __alloc_bootmem_node_high(pg_data_t *pgdat, unsigned long size, |
@@ -407,6 +413,12 @@ void * __init __alloc_bootmem_low_node(pg_data_t *pgdat, unsigned long size, | |||
407 | if (ptr) | 413 | if (ptr) |
408 | return ptr; | 414 | return ptr; |
409 | 415 | ||
410 | return __alloc_memory_core_early(MAX_NUMNODES, size, align, | 416 | ptr = __alloc_memory_core_early(MAX_NUMNODES, size, align, |
411 | goal, ARCH_LOW_ADDRESS_LIMIT); | 417 | goal, ARCH_LOW_ADDRESS_LIMIT); |
418 | if (ptr) | ||
419 | return ptr; | ||
420 | |||
421 | printk(KERN_ALERT "bootmem alloc of %lu bytes failed!\n", size); | ||
422 | panic("Out of memory"); | ||
423 | return NULL; | ||
412 | } | 424 | } |