[PATCH 10/13] ARM: k3: r5: delete fip image when it can't be opened

Sascha Hauer s.hauer at pengutronix.de
Thu Feb 27 23:16:58 PST 2025


In case the uploaded FIP image can't be opened due to corruption of
the image we end up in an endless loop trying to open the same image
again and again. Delete the uploaded image in this case to give the
user a chance to upload another image.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 arch/arm/mach-k3/r5.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-k3/r5.c b/arch/arm/mach-k3/r5.c
index cb52ff364d..c8a91e2597 100644
--- a/arch/arm/mach-k3/r5.c
+++ b/arch/arm/mach-k3/r5.c
@@ -319,6 +319,7 @@ static int do_dfu(void)
 			ret = load_fip("/fip.img", 0);
 			if (!ret)
 				return 0;
+			unlink("/fip.img");
 		}
 
 		command_slice_release();

-- 
2.39.5




More information about the barebox mailing list