summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Cordahi <christophercordahi@nanometrics.ca>2012-12-16 19:59:29 -0500
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2013-02-04 09:26:28 +0200
commite25e0a4de1237972a86e5831c8659c4068ff23f7 (patch)
treef2f07d4013b65a9c7b7a085bfcfa81c4d853d83f
parentb23b746cdcb0792b1268bc338acf29ec27739527 (diff)
downloadlinux-e25e0a4de1237972a86e5831c8659c4068ff23f7.tar.gz
linux-e25e0a4de1237972a86e5831c8659c4068ff23f7.tar.bz2
linux-e25e0a4de1237972a86e5831c8659c4068ff23f7.zip
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 <christophercordahi@nanometrics.ca> Acked-by: Shmulik Ladkani <shmulik.ladkani@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
-rw-r--r--drivers/mtd/cmdlinepart.c1
1 files changed, 1 insertions, 0 deletions
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;
}