From: Christopher Cordahi Date: Mon, 17 Dec 2012 00:59:29 +0000 (-0500) Subject: mtd: cmdlinepart: fix skipping zero sized partition X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=e25e0a4de1237972a86e5831c8659c4068ff23f7;p=deliverable%2Flinux.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 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; }