From af0a384320d23b6abfb45bdf5e092520c8cbf26f Mon Sep 17 00:00:00 2001 From: yangsong8 Date: Sat, 7 Jun 2025 20:13:51 +0800 Subject: [PATCH] binfmt/elf: fix issue of file not closing after being opened. When opening the file succeeds but reading the file fails in modlib_initialize, this will result in the open file not be closed. Signed-off-by: yangsong8 --- binfmt/elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binfmt/elf.c b/binfmt/elf.c index 5d881d30abf..806da76b406 100644 --- a/binfmt/elf.c +++ b/binfmt/elf.c @@ -107,7 +107,7 @@ static int elf_loadbinary(FAR struct binary_s *binp, if (ret != 0) { berr("Failed to initialize to load ELF program binary: %d\n", ret); - return ret; + goto errout_with_init; } /* Load the program binary */