aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/mct_u232.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/mct_u232.c')
-rw-r--r--drivers/usb/serial/mct_u232.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
index d501aefa2628..ad4998bbf16f 100644
--- a/drivers/usb/serial/mct_u232.c
+++ b/drivers/usb/serial/mct_u232.c
@@ -566,10 +566,13 @@ static void mct_u232_read_int_callback(struct urb *urb)
566 * Work-a-round: handle the 'usual' bulk-in pipe here 566 * Work-a-round: handle the 'usual' bulk-in pipe here
567 */ 567 */
568 if (urb->transfer_buffer_length > 2) { 568 if (urb->transfer_buffer_length > 2) {
569 tty = tty_port_tty_get(&port->port);
570 if (urb->actual_length) { 569 if (urb->actual_length) {
571 tty_insert_flip_string(tty, data, urb->actual_length); 570 tty = tty_port_tty_get(&port->port);
572 tty_flip_buffer_push(tty); 571 if (tty) {
572 tty_insert_flip_string(tty, data,
573 urb->actual_length);
574 tty_flip_buffer_push(tty);
575 }
573 tty_kref_put(tty); 576 tty_kref_put(tty);
574 } 577 }
575 goto exit; 578 goto exit;