From 929146f642fba6e829807509c0f27c075295b65a Mon Sep 17 00:00:00 2001 From: Johannes Weiner Date: Tue, 29 May 2012 15:06:35 -0700 Subject: [PATCH] --- yaml --- r: 308861 b: refs/heads/master c: 2c478eae96501163c5c5d5f682bba4d34a7ea1d4 h: refs/heads/master i: 308859: acacd1623373a44164d3dcabf19e430e1f75f4bf v: v3 --- [refs] | 2 +- trunk/mm/nobootmem.c | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index d162d7ddfd06..874a17c663e7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 421456edd27cf512b8f0025245a0f3572bd69b00 +refs/heads/master: 2c478eae96501163c5c5d5f682bba4d34a7ea1d4 diff --git a/trunk/mm/nobootmem.c b/trunk/mm/nobootmem.c index 1983fb1c7026..cca76207e61a 100644 --- a/trunk/mm/nobootmem.c +++ b/trunk/mm/nobootmem.c @@ -305,11 +305,17 @@ void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, ptr = __alloc_memory_core_early(MAX_NUMNODES, size, align, goal, -1ULL); - if (!ptr && goal) { + if (ptr) + return ptr; + + if (goal) { goal = 0; goto again; } - return ptr; + + printk(KERN_ALERT "bootmem alloc of %lu bytes failed!\n", size); + panic("Out of memory"); + return NULL; } 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, if (ptr) return ptr; - return __alloc_memory_core_early(MAX_NUMNODES, size, align, - goal, ARCH_LOW_ADDRESS_LIMIT); + ptr = __alloc_memory_core_early(MAX_NUMNODES, size, align, + goal, ARCH_LOW_ADDRESS_LIMIT); + if (ptr) + return ptr; + + printk(KERN_ALERT "bootmem alloc of %lu bytes failed!\n", size); + panic("Out of memory"); + return NULL; }