mtd: cmdlinepart: fix skipping zero sized partition
authorChristopher Cordahi <christophercordahi@nanometrics.ca>
Mon, 17 Dec 2012 00:59:29 +0000 (19:59 -0500)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Mon, 4 Feb 2013 07:26:28 +0000 (09:26 +0200)
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 <christophercordahi@nanometrics.ca>
Acked-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
drivers/mtd/cmdlinepart.c

index c533f27..c1efb4c 100644 (file)
@@ -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;
                }