From: Max Filippov Date: Mon, 9 Jun 2014 18:18:24 +0000 (+0400) Subject: xtensa: fix sysmem reservation at the end of existing block X-Git-Tag: v3.15.8~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f919283ecd0b3b6ee77a6691cce696ef6fb3e60;p=thirdparty%2Fkernel%2Fstable.git xtensa: fix sysmem reservation at the end of existing block commit be6ae382dc153da51cf066c8dd523aa955f02531 upstream. When sysmem reservation occurs exactly at the end of an existing block that block is deleted, because it is incorrectly included in the range of memblocks to remove. Fix that by skipping such block. Signed-off-by: Max Filippov Signed-off-by: Greg Kroah-Hartman --- diff --git a/arch/xtensa/mm/init.c b/arch/xtensa/mm/init.c index 4224256bb215f..77ed20209ca57 100644 --- a/arch/xtensa/mm/init.c +++ b/arch/xtensa/mm/init.c @@ -191,7 +191,7 @@ int __init mem_reserve(unsigned long start, unsigned long end, int must_exist) return -EINVAL; } - if (it && start - it->start < bank_sz) { + if (it && start - it->start <= bank_sz) { if (start == it->start) { if (end - it->start < bank_sz) { it->start = end;