diff --git a/mm/nobootmem.c b/mm/nobootmem.c index 19121ceb8874977310e0559ad0bf8488140d59b1..bb1a70cc97a7f165ebfbfd38c565c67acb8cb438 100644 --- a/mm/nobootmem.c +++ b/mm/nobootmem.c @@ -45,7 +45,9 @@ static void * __init __alloc_memory_core_early(int nid, u64 size, u64 align, if (!addr) return NULL; - memblock_reserve(addr, size); + if (memblock_reserve(addr, size)) + return NULL; + ptr = phys_to_virt(addr); memset(ptr, 0, size); /*