aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorBill Pemberton <wfp5p@virginia.edu>2009-07-14 15:33:52 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-07-28 14:07:10 -0700
commitf3a756883ac028c536479e2eb283477fec80c828 (patch)
treef4fdc7bb107c208a73bfe642ea6d82fa67030a7e /drivers/staging
parent4733fd328f14280900435d9dbae1487d110a4d56 (diff)
Staging: serqt_usb2: add missing calls to tty_kref_put()
tty_port_tty_get() was called without a corresponding tty_kref_put() in qt_read_bulk_callback() and qt_close(). Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/serqt_usb2/serqt_usb2.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/staging/serqt_usb2/serqt_usb2.c b/drivers/staging/serqt_usb2/serqt_usb2.c
index a9bd4106beb..f9ff9c26678 100644
--- a/drivers/staging/serqt_usb2/serqt_usb2.c
+++ b/drivers/staging/serqt_usb2/serqt_usb2.c
@@ -360,18 +360,18 @@ static void qt_read_bulk_callback(struct urb *urb)
if (port_paranoia_check(port, __func__) != 0) {
dbg("%s - port_paranoia_check, exiting\n", __func__);
qt_port->ReadBulkStopped = 1;
- return;
+ goto exit;
}
if (!serial) {
dbg("%s - bad serial pointer, exiting\n", __func__);
- return;
+ goto exit;
}
if (qt_port->closePending == 1) {
/* Were closing , stop reading */
dbg("%s - (qt_port->closepending == 1\n", __func__);
qt_port->ReadBulkStopped = 1;
- return;
+ goto exit;
}
/*
@@ -381,7 +381,7 @@ static void qt_read_bulk_callback(struct urb *urb)
*/
if (qt_port->RxHolding == 1) {
qt_port->ReadBulkStopped = 1;
- return;
+ goto exit;
}
if (urb->status) {
@@ -389,7 +389,7 @@ static void qt_read_bulk_callback(struct urb *urb)
dbg("%s - nonzero read bulk status received: %d\n",
__func__, urb->status);
- return;
+ goto exit;
}
if (tty && RxCount) {
@@ -463,6 +463,8 @@ static void qt_read_bulk_callback(struct urb *urb)
}
schedule_work(&port->work);
+exit:
+ tty_kref_put(tty);
}
/*
@@ -1041,7 +1043,7 @@ static void qt_block_until_empty(struct tty_struct *tty,
}
}
-static void qt_close( struct usb_serial_port *port)
+static void qt_close(struct usb_serial_port *port)
{
struct usb_serial *serial = port->serial;
struct quatech_port *qt_port;
@@ -1068,6 +1070,7 @@ static void qt_close( struct usb_serial_port *port)
/* wait up to for transmitter to empty */
if (serial->dev)
qt_block_until_empty(tty, qt_port);
+ tty_kref_put(tty);
/* Close uart channel */
status = qt_close_channel(serial, index);