binfmt/elf: Don't close filfd in the fail path

to avoid close the same handle twice because
the caller also call elf_uninit in this case

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Iddcbae9587d11d3b5b06e876d4a037ac0d11992e
This commit is contained in:
Xiang Xiao
2021-05-07 21:48:02 +08:00
committed by Brennan Ashton
parent e1ff0c4f08
commit 85c1354043

View File

@@ -161,7 +161,6 @@ int elf_init(FAR const char *filename, FAR struct elf_loadinfo_s *loadinfo)
if (ret < 0)
{
berr("Failed to read ELF header: %d\n", ret);
nx_close(loadinfo->filfd);
return ret;
}
@@ -181,7 +180,6 @@ int elf_init(FAR const char *filename, FAR struct elf_loadinfo_s *loadinfo)
*/
berr("Bad ELF header: %d\n", ret);
nx_close(loadinfo->filfd);
return ret;
}