[PATCH 2/3] MIPS: bootm: do not leak memory on error in of_overlay_load_firmware()

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


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

diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c
index 95e9dc0d7d..69ce9b3904 100644
--- a/arch/mips/lib/bootm.c
+++ b/arch/mips/lib/bootm.c
@@ -69,7 +69,7 @@ static int do_bootm_elf(struct image_data *data)
 
 	ret = of_overlay_load_firmware();
 	if (ret)
-		return ret;
+		goto bootm_free_fdt;
 
 	shutdown_barebox();
 
-- 
2.30.2




More information about the barebox mailing list