mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 16:29:59 +00:00
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>
This commit is contained in:
parent
b23b746cdc
commit
e25e0a4de1
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue