[PATCH 1/3] MIPS: bootm: do not free fdt pointer that contains an error

Denis Orlov denorl2009 at gmail.com
Wed Mar 15 01:59:51 PDT 2023


Also add a proper error message.

Signed-off-by: Denis Orlov <denorl2009 at gmail.com>
---
 arch/mips/lib/bootm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c
index 655535737e..95e9dc0d7d 100644
--- a/arch/mips/lib/bootm.c
+++ b/arch/mips/lib/bootm.c
@@ -57,8 +57,8 @@ static int do_bootm_elf(struct image_data *data)
 
 	fdt = bootm_get_devicetree(data);
 	if (IS_ERR(fdt)) {
-		ret = PTR_ERR(fdt);
-		goto bootm_free_fdt;
+		pr_err("Failed to load dtb\n");
+		return PTR_ERR(fdt);
 	}
 
 	pr_info("Starting application at 0x%08lx, dts 0x%08lx...\n",
-- 
2.30.2




More information about the barebox mailing list