aboutsummaryrefslogtreecommitdiffstats
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 17:07:10 -0400
commitf3a756883ac028c536479e2eb283477fec80c828 (patch)
treef4fdc7bb107c208a73bfe642ea6d82fa67030a7e
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>
-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 a9bd4106beb7..f9ff9c266780 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)
360 if (port_paranoia_check(port, __func__) != 0) { 360 if (port_paranoia_check(port, __func__) != 0) {
361 dbg("%s - port_paranoia_check, exiting\n", __func__); 361 dbg("%s - port_paranoia_check, exiting\n", __func__);
362 qt_port->ReadBulkStopped = 1; 362 qt_port->ReadBulkStopped = 1;
363 return; 363 goto exit;
364 } 364 }
365 365
366 if (!serial) { 366 if (!serial) {
367 dbg("%s - bad serial pointer, exiting\n", __func__); 367 dbg("%s - bad serial pointer, exiting\n", __func__);
368 return; 368 goto exit;
369 } 369 }
370 if (qt_port->closePending == 1) { 370 if (qt_port->closePending == 1) {
371 /* Were closing , stop reading */ 371 /* Were closing , stop reading */
372 dbg("%s - (qt_port->closepending == 1\n", __func__); 372 dbg("%s - (qt_port->closepending == 1\n", __func__);
373 qt_port->ReadBulkStopped = 1; 373 qt_port->ReadBulkStopped = 1;
374 return; 374 goto exit;
375 } 375 }
376 376
377 /* 377 /*
@@ -381,7 +381,7 @@ static void qt_read_bulk_callback(struct urb *urb)
381 */ 381 */
382 if (qt_port->RxHolding == 1) { 382 if (qt_port->RxHolding == 1) {
383 qt_port->ReadBulkStopped = 1; 383 qt_port->ReadBulkStopped = 1;
384 return; 384 goto exit;
385 } 385 }
386 386
387 if (urb->status) { 387 if (urb->status) {
@@ -389,7 +389,7 @@ static void qt_read_bulk_callback(struct urb *urb)
389 389
390 dbg("%s - nonzero read bulk status received: %d\n", 390 dbg("%s - nonzero read bulk status received: %d\n",
391 __func__, urb->status); 391 __func__, urb->status);
392 return; 392 goto exit;
393 } 393 }
394 394
395 if (tty && RxCount) { 395 if (tty && RxCount) {
@@ -463,6 +463,8 @@ static void qt_read_bulk_callback(struct urb *urb)
463 } 463 }
464 464
465 schedule_work(&port->work); 465 schedule_work(&port->work);
466exit:
467 tty_kref_put(tty);
466} 468}
467 469
468/* 470/*
@@ -1041,7 +1043,7 @@ static void qt_block_until_empty(struct tty_struct *tty,
1041 } 1043 }
1042} 1044}
1043 1045
1044static void qt_close( struct usb_serial_port *port) 1046static void qt_close(struct usb_serial_port *port)
1045{ 1047{
1046 struct usb_serial *serial = port->serial; 1048 struct usb_serial *serial = port->serial;
1047 struct quatech_port *qt_port; 1049 struct quatech_port *qt_port;
@@ -1068,6 +1070,7 @@ static void qt_close( struct usb_serial_port *port)
1068 /* wait up to for transmitter to empty */ 1070 /* wait up to for transmitter to empty */
1069 if (serial->dev) 1071 if (serial->dev)
1070 qt_block_until_empty(tty, qt_port); 1072 qt_block_until_empty(tty, qt_port);
1073 tty_kref_put(tty);
1071 1074
1072 /* Close uart channel */ 1075 /* Close uart channel */
1073 status = qt_close_channel(serial, index); 1076 status = qt_close_channel(serial, index);