diff options
author | Alan Cox <alan@redhat.com> | 2008-10-30 11:54:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-30 15:09:07 -0400 |
commit | fce4877a6792ad72b88f6fd7556d19da5f20364d (patch) | |
tree | cc272f4b863ebfb6595974feca28168cb59fc367 /drivers/usb | |
parent | 0fb7f4f0cef8e7d2944189ff2cb68694ef4b683a (diff) |
tty: Fix USB kref leak
When we close we must clear the extra reference we got when we read
port->tty. Setting the port tty NULL will clear the kref held by the driver
but not the one we obtained ourselves while doing the lookup.
Signed-off-by: Alan Cox <alan@redhat.com>
Tested-by: Helge Hafting <helge.hafting@aitel.hist.no>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 8be3f39891c7..794b5ffe4397 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -281,6 +281,7 @@ static void serial_close(struct tty_struct *tty, struct file *filp) | |||
281 | if (tty->driver_data) | 281 | if (tty->driver_data) |
282 | tty->driver_data = NULL; | 282 | tty->driver_data = NULL; |
283 | tty_port_tty_set(&port->port, NULL); | 283 | tty_port_tty_set(&port->port, NULL); |
284 | tty_kref_put(tty); | ||
284 | } | 285 | } |
285 | } | 286 | } |
286 | 287 | ||