Skip to content

Commit b40997b

Browse files
neuschaefertorvalds
authored andcommitted
um: drivers/xterm.c: fix a file descriptor leak
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 <[email protected]> Signed-off-by: Richard Weinberger <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent e5f0bdc commit b40997b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/um/drivers/xterm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ static int xterm_open(int input, int output, int primary, void *d,
123123
err = -errno;
124124
printk(UM_KERN_ERR "xterm_open : unlink failed, errno = %d\n",
125125
errno);
126+
close(fd);
126127
return err;
127128
}
128129
close(fd);

0 commit comments

Comments
 (0)