From patchwork Fri Jun 12 12:41:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 242174 List-Id: U-Boot discussion From: t-kristo at ti.com (Tero Kristo) Date: Fri, 12 Jun 2020 15:41:19 +0300 Subject: [PATCH 2/4] image: fdt: bail out with error if no boot time FDT image found In-Reply-To: <20200612124121.13846-1-t-kristo@ti.com> References: <20200612124121.13846-1-t-kristo@ti.com> Message-ID: <20200612124121.13846-3-t-kristo@ti.com> Currently the boot continues if the FDT image is clearly corrupted, which just causes the loaded OS to hang. Abort boot properly if the FDT is corrupted. Signed-off-by: Tero Kristo --- common/image-fdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/image-fdt.c b/common/image-fdt.c index b63e772bd6..7005b34966 100644 --- a/common/image-fdt.c +++ b/common/image-fdt.c @@ -426,7 +426,7 @@ int boot_get_fdt(int flag, int argc, char *const argv[], uint8_t arch, break; default: puts("ERROR: Did not find a cmdline Flattened Device Tree\n"); - goto no_fdt; + goto error; } printf(" Booting using the fdt blob at %#08lx\n", fdt_addr);