mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-12-28 16:56:26 +00:00
mtd: mtdpart: check for subpartitions parsing result
parse_mtd_partitions() may return an error so it should be checked and optionally passed up Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20230927202657.27169-1-zajec5@gmail.com
This commit is contained in:
parent
8baba8d52f
commit
5c2f7727d4
@ -426,7 +426,11 @@ int add_mtd_partitions(struct mtd_info *parent,
|
||||
mtd_add_partition_attrs(child);
|
||||
|
||||
/* Look for subpartitions */
|
||||
parse_mtd_partitions(child, parts[i].types, NULL);
|
||||
ret = parse_mtd_partitions(child, parts[i].types, NULL);
|
||||
if (ret < 0) {
|
||||
pr_err("Failed to parse subpartitions: %d\n", ret);
|
||||
goto err_del_partitions;
|
||||
}
|
||||
|
||||
cur_offset = child->part.offset + child->part.size;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user