mirror of
https://github.com/apache/nuttx.git
synced 2025-12-07 10:03:38 +08:00
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:
committed by
Brennan Ashton
parent
e1ff0c4f08
commit
85c1354043
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user