diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index 55511a90d0..f711c8ef4f 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -282,6 +282,13 @@ static int spl_load_fit_image(struct spl_load_info *info, ulong sector, if (fit_image_get_data_size(fit, node, &len)) return -ENOENT; + /* Dont bother to copy 0 byte data, but warn, though */ + if (!len) { + log_warning("%s: Skip load '%s': image size is 0!\n", + __func__, fit_get_name(fit, node, NULL)); + return 0; + } + load_ptr = (load_addr + align_len) & ~align_len; length = len;