diff options
Diffstat (limited to 'drivers/usb/serial/mct_u232.c')
-rw-r--r-- | drivers/usb/serial/mct_u232.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c index 0ded8bd6ec85..9b2cef81cde0 100644 --- a/drivers/usb/serial/mct_u232.c +++ b/drivers/usb/serial/mct_u232.c | |||
@@ -563,10 +563,11 @@ static void mct_u232_read_int_callback(struct urb *urb) | |||
563 | * Work-a-round: handle the 'usual' bulk-in pipe here | 563 | * Work-a-round: handle the 'usual' bulk-in pipe here |
564 | */ | 564 | */ |
565 | if (urb->transfer_buffer_length > 2) { | 565 | if (urb->transfer_buffer_length > 2) { |
566 | tty = port->port.tty; | 566 | tty = tty_port_tty_get(&port->port); |
567 | if (urb->actual_length) { | 567 | if (urb->actual_length) { |
568 | tty_insert_flip_string(tty, data, urb->actual_length); | 568 | tty_insert_flip_string(tty, data, urb->actual_length); |
569 | tty_flip_buffer_push(tty); | 569 | tty_flip_buffer_push(tty); |
570 | tty_kref_put(tty); | ||
570 | } | 571 | } |
571 | goto exit; | 572 | goto exit; |
572 | } | 573 | } |
@@ -591,7 +592,7 @@ static void mct_u232_read_int_callback(struct urb *urb) | |||
591 | * to look in to this before committing any code. | 592 | * to look in to this before committing any code. |
592 | */ | 593 | */ |
593 | if (priv->last_lsr & MCT_U232_LSR_ERR) { | 594 | if (priv->last_lsr & MCT_U232_LSR_ERR) { |
594 | tty = port->port.tty; | 595 | tty = tty_port_tty_get(&port->port); |
595 | /* Overrun Error */ | 596 | /* Overrun Error */ |
596 | if (priv->last_lsr & MCT_U232_LSR_OE) { | 597 | if (priv->last_lsr & MCT_U232_LSR_OE) { |
597 | } | 598 | } |
@@ -604,6 +605,7 @@ static void mct_u232_read_int_callback(struct urb *urb) | |||
604 | /* Break Indicator */ | 605 | /* Break Indicator */ |
605 | if (priv->last_lsr & MCT_U232_LSR_BI) { | 606 | if (priv->last_lsr & MCT_U232_LSR_BI) { |
606 | } | 607 | } |
608 | tty_kref_put(tty); | ||
607 | } | 609 | } |
608 | #endif | 610 | #endif |
609 | spin_unlock_irqrestore(&priv->lock, flags); | 611 | spin_unlock_irqrestore(&priv->lock, flags); |