spl: fit: check image length
Do not go further if it is 0. Signed-off-by: Joseph Chen <chenjh@rock-chips.com> Change-Id: I1d4c07303a4998a9c112986ee4efda39c1d55d63
This commit is contained in:
parent
0732900259
commit
359ed52cc2
|
|
@ -204,6 +204,9 @@ static int spl_load_fit_image(struct spl_load_info *info, ulong sector,
|
||||||
if (fit_image_get_data_size(fit, node, &len))
|
if (fit_image_get_data_size(fit, node, &len))
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
|
|
||||||
|
if (!len)
|
||||||
|
return 0;
|
||||||
|
|
||||||
load_ptr = (load_addr + align_len) & ~align_len;
|
load_ptr = (load_addr + align_len) & ~align_len;
|
||||||
#if defined(CONFIG_ARCH_ROCKCHIP)
|
#if defined(CONFIG_ARCH_ROCKCHIP)
|
||||||
if ((load_ptr < CONFIG_SYS_SDRAM_BASE) ||
|
if ((load_ptr < CONFIG_SYS_SDRAM_BASE) ||
|
||||||
|
|
@ -232,6 +235,9 @@ static int spl_load_fit_image(struct spl_load_info *info, ulong sector,
|
||||||
debug("Embedded data: dst=%lx, size=%lx\n", load_addr,
|
debug("Embedded data: dst=%lx, size=%lx\n", load_addr,
|
||||||
(unsigned long)length);
|
(unsigned long)length);
|
||||||
src = (void *)data;
|
src = (void *)data;
|
||||||
|
|
||||||
|
if (!length)
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check hashes and signature */
|
/* Check hashes and signature */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue