From e25e0a4de1237972a86e5831c8659c4068ff23f7 Mon Sep 17 00:00:00 2001 From: Christopher Cordahi Date: Sun, 16 Dec 2012 19:59:29 -0500 Subject: [PATCH] mtd: cmdlinepart: fix skipping zero sized partition Decrement index i after skipping a zero sized partition. On next loop iteration, the index will be the same as before, but the data will be new as it was moved when earlier partition was skipped. Signed-off-by: Christopher Cordahi Acked-by: Shmulik Ladkani Signed-off-by: Artem Bityutskiy --- drivers/mtd/cmdlinepart.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/cmdlinepart.c b/drivers/mtd/cmdlinepart.c index c533f27d863f..c1efb4c1d3d2 100644 --- a/drivers/mtd/cmdlinepart.c +++ b/drivers/mtd/cmdlinepart.c @@ -337,6 +337,7 @@ static int parse_cmdline_partitions(struct mtd_info *master, part->num_parts--; memmove(&part->parts[i], &part->parts[i + 1], sizeof(*part->parts) * (part->num_parts - i)); + i--; continue; } -- 2.11.0