From: "Jonathan Neuschäfer" <j.neuschaefer@gmx.net>
To: user-mode-linux-devel@lists.sourceforge.net
Cc: "Jeff Dike" <jdike@addtoit.com>,
"Richard Weinberger" <richard@nod.at>,
linux-kernel@vger.kernel.org,
"Jonathan Neuschäfer" <j.neuschaefer@gmx.net>
Subject: [PATCH] um: drivers/xterm.c: fix a file descriptor leak
Date: Fri, 12 Aug 2011 02:24:10 +0200 [thread overview]
Message-ID: <1313108650-5941-1-git-send-email-j.neuschaefer@gmx.net> (raw)
I could use out_close1, but that seems to be the code path to close the
fd returned by os_create_unix_socket, and using it to close the fd
returned by mkstemp might lead to some confusion, so I don't do it.
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
---
arch/um/drivers/xterm.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/um/drivers/xterm.c b/arch/um/drivers/xterm.c
index 8ac7146..2e1de57 100644
--- a/arch/um/drivers/xterm.c
+++ b/arch/um/drivers/xterm.c
@@ -123,6 +123,7 @@ static int xterm_open(int input, int output, int primary, void *d,
err = -errno;
printk(UM_KERN_ERR "xterm_open : unlink failed, errno = %d\n",
errno);
+ close(fd);
return err;
}
close(fd);
--
1.7.5.4
reply other threads:[~2011-08-12 0:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1313108650-5941-1-git-send-email-j.neuschaefer@gmx.net \
--to=j.neuschaefer@gmx.net \
--cc=jdike@addtoit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=richard@nod.at \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/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
all inboxes | Powered by JetHome®