]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Common:fdt: Check for error return value
authorHongwei Zhang <hongweiz@ami.com>
Wed, 2 Dec 2020 19:47:03 +0000 (14:47 -0500)
committerSimon Glass <sjg@chromium.org>
Wed, 23 Dec 2020 03:39:25 +0000 (20:39 -0700)
Check for negative return value of fdt_noffset from calling
boot_get_fdt_fit().

Signed-off-by: Hongwei Zhang <hongweiz@ami.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
common/image-fdt.c

index 327a8c4c39591ba5867bd79d610e91fed3c81332..707b44a69d749171bb77d7691a152638b2dbab83 100644 (file)
@@ -407,6 +407,9 @@ int boot_get_fdt(int flag, int argc, char *const argv[], uint8_t arch,
                                        &fit_uname_config,
                                        arch, &load, &len);
 
+                               if (fdt_noffset < 0)
+                                       goto error;
+
                                images->fit_hdr_fdt = map_sysmem(fdt_addr, 0);
                                images->fit_uname_fdt = fit_uname_fdt;
                                images->fit_noffset_fdt = fdt_noffset;