Skip to content

Commit

Permalink
um: drivers/xterm.c: fix a file descriptor leak
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
neuschaefer authored and torvalds committed Sep 15, 2011
1 parent e5f0bdc commit b40997b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/um/drivers/xterm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b40997b

Please sign in to comment.