summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorCong Ding <dinggnu@gmail.com>2013-01-14 17:13:35 +0000
committerH. Peter Anvin <hpa@linux.intel.com>2013-01-27 10:24:28 -0800
commit65315d4889d403ea025081d8ca85ddf7b9c10f39 (patch)
treed478fa660da8fc7ea029254ab746901aabb4c938 /arch
parent949db153b6466c6f7cad5a427ecea94985927311 (diff)
x86/boot: Fix minor fd leakage in tools/relocs.c
The opened file should be closed. Signed-off-by: Cong Ding <dinggnu@gmail.com> Cc: Kusanagi Kouichi <slash@ac.auone-net.jp> Cc: Jarkko Sakkinen <jarkko.sakkinen@intel.com> Cc: Jiri Kosina <jkosina@suse.cz> Cc: Matt Fleming <matt.fleming@intel.com> Link: http://lkml.kernel.org/r/1358183628-27784-1-git-send-email-dinggnu@gmail.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/tools/relocs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c
index 5a1847d6193..79d67bd507f 100644
--- a/arch/x86/tools/relocs.c
+++ b/arch/x86/tools/relocs.c
@@ -814,12 +814,14 @@ int main(int argc, char **argv)
read_relocs(fp);
if (show_absolute_syms) {
print_absolute_symbols();
- return 0;
+ goto out;
}
if (show_absolute_relocs) {
print_absolute_relocs();
- return 0;
+ goto out;
}
emit_relocs(as_text, use_real_mode);
+out:
+ fclose(fp);
return 0;
}