[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1296999075-8022-1-git-send-email-namhyung@gmail.com>
Date: Sun, 6 Feb 2011 22:31:15 +0900
From: Namhyung Kim <namhyung@...il.com>
To: linux-mm@...ck.org
Cc: linux-kernel@...r.kernel.org,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Yinghai Lu <yinghai@...nel.org>
Subject: [PATCH] memblock: Fix error path in memblock_add_region()
@type->regions should be restored if memblock_double_array() fails.
Signed-off-by: Namhyung Kim <namhyung@...il.com>
Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc: Yinghai Lu <yinghai@...nel.org>
---
mm/memblock.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/mm/memblock.c b/mm/memblock.c
index bdba245d8afd..49284f9f99a6 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -379,6 +379,10 @@ static long __init_memblock memblock_add_region(struct memblock_type *type, phys
*/
if (type->cnt == type->max && memblock_double_array(type)) {
type->cnt--;
+ for (++i; i < type->cnt; i++) {
+ type->regions[i].base = type->regions[i+1].base;
+ type->regions[i].size = type->regions[i+1].size;
+ }
return -1;
}
--
1.7.3.4.600.g982838b0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists