diff --git a/mm/memblock.c b/mm/memblock.c index 87d21a6ff63c5730a2708414b6054a139b77cdf1..39a31e7f004505991e37219bdb1e17f571efb933 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -1077,6 +1077,9 @@ static void * __init memblock_virt_alloc_internal( if (!align) align = SMP_CACHE_BYTES; + if (max_addr > memblock.current_limit) + max_addr = memblock.current_limit; + again: alloc = memblock_find_in_range_node(size, align, min_addr, max_addr, nid);