mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2025-12-10 07:44:53 +01:00
ipq: Add check to avoid overwriting successive partitions
This change adds a check to detect if the size of image to be flashed fits within the respective partition region. Change-Id: I794262fa759eef4ecc726252fb3d234c087f2b4d Signed-off-by: Pavithra Palanisamy <pavip@codeaurora.org>
This commit is contained in:
parent
241e5e86b0
commit
4bb8ae0f50
1 changed files with 6 additions and 0 deletions
|
|
@ -270,6 +270,12 @@ char * const argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flash_cmd) {
|
if (flash_cmd) {
|
||||||
|
|
||||||
|
if (file_size > part_size) {
|
||||||
|
printf("Image size is greater than partition memory\n");
|
||||||
|
return CMD_RET_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
if (flash_type == SMEM_BOOT_NAND_FLASH) {
|
if (flash_type == SMEM_BOOT_NAND_FLASH) {
|
||||||
|
|
||||||
adj_size = file_size % nand->writesize;
|
adj_size = file_size % nand->writesize;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue