[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1314634419-24766-3-git-send-email-richard@nod.at>
Date: Mon, 29 Aug 2011 18:13:32 +0200
From: Richard Weinberger <richard@....at>
To: akpm@...ux-foundation.org
Cc: linux-kernel@...r.kernel.org,
user-mode-linux-devel@...ts.sourceforge.net,
Jonathan Neuschäfer <j.neuschaefer@....net>,
Richard Weinberger <richard@....at>
Subject: [PATCH 2/9] um: drivers/xterm.c: fix a file descriptor leak
From: Jonathan Neuschäfer <j.neuschaefer@....net>
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@....net>
Signed-off-by: Richard Weinberger <richard@....at>
---
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.6.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists