diff options
-rw-r--r-- | mm/nobootmem.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/mm/nobootmem.c b/mm/nobootmem.c index 24f0fc1a56d6..e53bb8a256b1 100644 --- a/mm/nobootmem.c +++ b/mm/nobootmem.c | |||
@@ -298,13 +298,19 @@ void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, | |||
298 | if (WARN_ON_ONCE(slab_is_available())) | 298 | if (WARN_ON_ONCE(slab_is_available())) |
299 | return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); | 299 | return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); |
300 | 300 | ||
301 | again: | ||
301 | ptr = __alloc_memory_core_early(pgdat->node_id, size, align, | 302 | ptr = __alloc_memory_core_early(pgdat->node_id, size, align, |
302 | goal, -1ULL); | 303 | goal, -1ULL); |
303 | if (ptr) | 304 | if (ptr) |
304 | return ptr; | 305 | return ptr; |
305 | 306 | ||
306 | return __alloc_memory_core_early(MAX_NUMNODES, size, align, | 307 | ptr = __alloc_memory_core_early(MAX_NUMNODES, size, align, |
307 | goal, -1ULL); | 308 | goal, -1ULL); |
309 | if (!ptr && goal) { | ||
310 | goal = 0; | ||
311 | goto again; | ||
312 | } | ||
313 | return ptr; | ||
308 | } | 314 | } |
309 | 315 | ||
310 | void * __init __alloc_bootmem_node_high(pg_data_t *pgdat, unsigned long size, | 316 | void * __init __alloc_bootmem_node_high(pg_data_t *pgdat, unsigned long size, |