From: Hongwei Zhang Date: Wed, 2 Dec 2020 14:47:03 -0500 Subject: [u-boot, v2019.04-aspeed, v1 1/1] Common:fdt: Check for error return value In-Reply-To: <20201202194703.8793-1-hongweiz@ami.com> References: <20201202194703.8793-1-hongweiz@ami.com> Message-ID: <20201202194703.8793-2-hongweiz@ami.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Check for negative return value of fdt_noffset from calling boot_get_fdt_fit(). Signed-off-by: Hongwei Zhang --- common/image-fdt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/image-fdt.c b/common/image-fdt.c index 01186aeac7..52ada56fc1 100644 --- a/common/image-fdt.c +++ b/common/image-fdt.c @@ -402,6 +402,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; -- 2.17.1