From ee31afb9c5c0e78819ce624e3a930d31b97527cd Mon Sep 17 00:00:00 2001 From: grygoriis Date: Tue, 28 Jan 2014 21:59:30 +0200 Subject: [PATCH] mm/memblock: fix upper boundary of allocating region Correct memblock_virt_allocX() API to limit allocations below memblock.current_limit. Signed-off-by: grygoriis --- mm/memblock.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/mm/memblock.c b/mm/memblock.c index 87d21a6..e93d669 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); -- 1.7.4.1