From patchwork Mon Dec 17 00:59:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1/2] mtd: cmdlinepart: fix skipping zero sized partition Date: Sun, 16 Dec 2012 14:59:29 -0000 From: Christopher Cordahi X-Patchwork-Id: 206758 Message-Id: <714bcce84fccef617818f8916475a666f880cbf1.1355438632.git.christophercordahi@nanometrics.ca> To: David Woodhouse Cc: Artem Bityutskiy , Linux MTD mailing list , Shmulik Ladkani , Christopher Cordahi 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 --- drivers/mtd/cmdlinepart.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) 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; }