From: tip-bot for Cong Ding <dinggnu@gmail.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
slash@ac.auone-net.jp, jkosina@suse.cz,
jarkko.sakkinen@intel.com, matt.fleming@intel.com,
dinggnu@gmail.com, tglx@linutronix.de
Subject: [tip:x86/boot] x86/boot: Fix minor fd leakage in tools/relocs.c
Date: Thu, 24 Jan 2013 12:09:47 -0800 [thread overview]
Message-ID: <tip-585376216a829d1ddfb3e57cb50c72c23adb484f@git.kernel.org> (raw)
In-Reply-To: <1358183628-27784-1-git-send-email-dinggnu@gmail.com>
Commit-ID: 585376216a829d1ddfb3e57cb50c72c23adb484f
Gitweb: http://git.kernel.org/tip/585376216a829d1ddfb3e57cb50c72c23adb484f
Author: Cong Ding <dinggnu@gmail.com>
AuthorDate: Mon, 14 Jan 2013 17:13:35 +0000
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 24 Jan 2013 13:07:23 +0100
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>
---
arch/x86/tools/relocs.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c
index 5a1847d..79d67bd 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;
}
next prev parent reply other threads:[~2013-01-24 20:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-14 17:13 [PATCH] x86: tools/relocs.c: fix resource leakage Cong Ding
2013-01-24 20:09 ` tip-bot for Cong Ding [this message]
2013-01-28 0:06 ` [tip:x86/boot] x86/boot: Fix minor fd leakage in tools/relocs.c tip-bot for Cong Ding
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-585376216a829d1ddfb3e57cb50c72c23adb484f@git.kernel.org \
--to=dinggnu@gmail.com \
--cc=hpa@zytor.com \
--cc=jarkko.sakkinen@intel.com \
--cc=jkosina@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=matt.fleming@intel.com \
--cc=mingo@kernel.org \
--cc=slash@ac.auone-net.jp \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).