aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/kl5kusb105.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/kl5kusb105.c')
-rw-r--r--drivers/usb/serial/kl5kusb105.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c
index fc9e14a1e9b3..769d910ae0a5 100644
--- a/drivers/usb/serial/kl5kusb105.c
+++ b/drivers/usb/serial/kl5kusb105.c
@@ -389,7 +389,6 @@ static void klsi_105_process_read_urb(struct urb *urb)
389{ 389{
390 struct usb_serial_port *port = urb->context; 390 struct usb_serial_port *port = urb->context;
391 unsigned char *data = urb->transfer_buffer; 391 unsigned char *data = urb->transfer_buffer;
392 struct tty_struct *tty;
393 unsigned len; 392 unsigned len;
394 393
395 /* empty urbs seem to happen, we ignore them */ 394 /* empty urbs seem to happen, we ignore them */
@@ -401,19 +400,14 @@ static void klsi_105_process_read_urb(struct urb *urb)
401 return; 400 return;
402 } 401 }
403 402
404 tty = tty_port_tty_get(&port->port);
405 if (!tty)
406 return;
407
408 len = get_unaligned_le16(data); 403 len = get_unaligned_le16(data);
409 if (len > urb->actual_length - KLSI_HDR_LEN) { 404 if (len > urb->actual_length - KLSI_HDR_LEN) {
410 dev_dbg(&port->dev, "%s - packet length mismatch\n", __func__); 405 dev_dbg(&port->dev, "%s - packet length mismatch\n", __func__);
411 len = urb->actual_length - KLSI_HDR_LEN; 406 len = urb->actual_length - KLSI_HDR_LEN;
412 } 407 }
413 408
414 tty_insert_flip_string(tty, data + KLSI_HDR_LEN, len); 409 tty_insert_flip_string(&port->port, data + KLSI_HDR_LEN, len);
415 tty_flip_buffer_push(tty); 410 tty_flip_buffer_push(&port->port);
416 tty_kref_put(tty);
417} 411}
418 412
419static void klsi_105_set_termios(struct tty_struct *tty, 413static void klsi_105_set_termios(struct tty_struct *tty,