diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index 7b30ad331b..5d2ddfb7c7 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -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)) return -ENOENT; + if (!len) + return 0; + load_ptr = (load_addr + align_len) & ~align_len; #if defined(CONFIG_ARCH_ROCKCHIP) 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, (unsigned long)length); src = (void *)data; + + if (!length) + return 0; } /* Check hashes and signature */