summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/cmdlinepart.c
diff options
context:
space:
mode:
authorChristopher Cordahi2012-12-17 01:59:29 +0100
committerArtem Bityutskiy2013-02-04 08:26:28 +0100
commite25e0a4de1237972a86e5831c8659c4068ff23f7 (patch)
treef2f07d4013b65a9c7b7a085bfcfa81c4d853d83f /drivers/mtd/cmdlinepart.c
parentmtd: gpmi: Always report ECC stats and return max_bitflips (diff)
downloadkernel-qcow2-linux-e25e0a4de1237972a86e5831c8659c4068ff23f7.tar.gz
kernel-qcow2-linux-e25e0a4de1237972a86e5831c8659c4068ff23f7.tar.xz
kernel-qcow2-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>
Diffstat (limited to 'drivers/mtd/cmdlinepart.c')
-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;
}