Skip to content

Commit

Permalink
mtd: cmdlinepart: fix skipping zero sized partition
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christopher Cordahi authored and Artem Bityutskiy committed Feb 4, 2013
1 parent b23b746 commit e25e0a4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/mtd/cmdlinepart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit e25e0a4

Please sign in to comment.