From: Christopher Cordahi Date: Mon, 17 Dec 2012 00:59:29 +0000 (-0500) Subject: mtd: cmdlinepart: fix skipping zero sized partition X-Git-Tag: v3.9-rc1~18^2~41 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e25e0a4de1237972a86e5831c8659c4068ff23f7;p=platform%2Fkernel%2Flinux-stable.git 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 --- diff --git a/drivers/mtd/cmdlinepart.c b/drivers/mtd/cmdlinepart.c index c533f27..c1efb4c 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; }