mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2025-12-10 07:44:53 +01:00
common: cmd_mtdparts: skip partitions exceeding flash size
Change-Id: Icc9fcd4bcc8b2d7d5e47598c1acc6058ecf203d9 Signed-off-by: Sridharan S N <quic_sridsn@quicinc.com>
This commit is contained in:
parent
7c9be6eda9
commit
9db093d00e
2 changed files with 4 additions and 2 deletions
|
|
@ -411,8 +411,7 @@ static int part_validate(struct mtdids *id, struct part_info *part)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (part->offset + part->size > id->size) {
|
if (part->offset + part->size > id->size) {
|
||||||
printf("%s: partitioning exceeds flash size\n", id->mtd_id);
|
printf("%s: partitioning (%s) exceeds flash size\n", id->mtd_id, part->name);
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -817,6 +817,9 @@ int fdt_node_set_part_info(void *blob, int parent_offset,
|
||||||
|
|
||||||
part = list_entry(pentry, struct part_info, link);
|
part = list_entry(pentry, struct part_info, link);
|
||||||
|
|
||||||
|
if (part->offset + part->size > dev->id->size)
|
||||||
|
continue;
|
||||||
|
|
||||||
debug("%2d: %-20s0x%08llx\t0x%08llx\t%d\n",
|
debug("%2d: %-20s0x%08llx\t0x%08llx\t%d\n",
|
||||||
part_num, part->name, part->size,
|
part_num, part->name, part->size,
|
||||||
part->offset, part->mask_flags);
|
part->offset, part->mask_flags);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue