aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/digi_acceleport.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/digi_acceleport.c')
-rw-r--r--drivers/usb/serial/digi_acceleport.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index fd35f73b5721..b92070c103cd 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -609,8 +609,10 @@ static void digi_wakeup_write_lock(struct work_struct *work)
609static void digi_wakeup_write(struct usb_serial_port *port) 609static void digi_wakeup_write(struct usb_serial_port *port)
610{ 610{
611 struct tty_struct *tty = tty_port_tty_get(&port->port); 611 struct tty_struct *tty = tty_port_tty_get(&port->port);
612 tty_wakeup(tty); 612 if (tty) {
613 tty_kref_put(tty); 613 tty_wakeup(tty);
614 tty_kref_put(tty);
615 }
614} 616}
615 617
616 618
@@ -1682,7 +1684,7 @@ static int digi_read_inb_callback(struct urb *urb)
1682 priv->dp_throttle_restart = 1; 1684 priv->dp_throttle_restart = 1;
1683 1685
1684 /* receive data */ 1686 /* receive data */
1685 if (opcode == DIGI_CMD_RECEIVE_DATA) { 1687 if (tty && opcode == DIGI_CMD_RECEIVE_DATA) {
1686 /* get flag from port_status */ 1688 /* get flag from port_status */
1687 flag = 0; 1689 flag = 0;
1688 1690
@@ -1763,10 +1765,12 @@ static int digi_read_oob_callback(struct urb *urb)
1763 return -1; 1765 return -1;
1764 1766
1765 tty = tty_port_tty_get(&port->port); 1767 tty = tty_port_tty_get(&port->port);
1768
1766 rts = 0; 1769 rts = 0;
1767 rts = tty->termios->c_cflag & CRTSCTS; 1770 if (tty)
1771 rts = tty->termios->c_cflag & CRTSCTS;
1768 1772
1769 if (opcode == DIGI_CMD_READ_INPUT_SIGNALS) { 1773 if (tty && opcode == DIGI_CMD_READ_INPUT_SIGNALS) {
1770 spin_lock(&priv->dp_port_lock); 1774 spin_lock(&priv->dp_port_lock);
1771 /* convert from digi flags to termiox flags */ 1775 /* convert from digi flags to termiox flags */
1772 if (val & DIGI_READ_INPUT_SIGNALS_CTS) { 1776 if (val & DIGI_READ_INPUT_SIGNALS_CTS) {