diff options
Diffstat (limited to 'drivers/usb/serial/keyspan.c')
-rw-r--r-- | drivers/usb/serial/keyspan.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index 077c714f1285..e07b15ed5814 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c | |||
@@ -410,6 +410,8 @@ static void usa26_instat_callback(struct urb *urb) | |||
410 | } | 410 | } |
411 | port = serial->port[msg->port]; | 411 | port = serial->port[msg->port]; |
412 | p_priv = usb_get_serial_port_data(port); | 412 | p_priv = usb_get_serial_port_data(port); |
413 | if (!p_priv) | ||
414 | goto resubmit; | ||
413 | 415 | ||
414 | /* Update handshaking pin state information */ | 416 | /* Update handshaking pin state information */ |
415 | old_dcd_state = p_priv->dcd_state; | 417 | old_dcd_state = p_priv->dcd_state; |
@@ -420,7 +422,7 @@ static void usa26_instat_callback(struct urb *urb) | |||
420 | 422 | ||
421 | if (old_dcd_state != p_priv->dcd_state) | 423 | if (old_dcd_state != p_priv->dcd_state) |
422 | tty_port_tty_hangup(&port->port, true); | 424 | tty_port_tty_hangup(&port->port, true); |
423 | 425 | resubmit: | |
424 | /* Resubmit urb so we continue receiving */ | 426 | /* Resubmit urb so we continue receiving */ |
425 | err = usb_submit_urb(urb, GFP_ATOMIC); | 427 | err = usb_submit_urb(urb, GFP_ATOMIC); |
426 | if (err != 0) | 428 | if (err != 0) |
@@ -527,6 +529,8 @@ static void usa28_instat_callback(struct urb *urb) | |||
527 | } | 529 | } |
528 | port = serial->port[msg->port]; | 530 | port = serial->port[msg->port]; |
529 | p_priv = usb_get_serial_port_data(port); | 531 | p_priv = usb_get_serial_port_data(port); |
532 | if (!p_priv) | ||
533 | goto resubmit; | ||
530 | 534 | ||
531 | /* Update handshaking pin state information */ | 535 | /* Update handshaking pin state information */ |
532 | old_dcd_state = p_priv->dcd_state; | 536 | old_dcd_state = p_priv->dcd_state; |
@@ -537,7 +541,7 @@ static void usa28_instat_callback(struct urb *urb) | |||
537 | 541 | ||
538 | if (old_dcd_state != p_priv->dcd_state && old_dcd_state) | 542 | if (old_dcd_state != p_priv->dcd_state && old_dcd_state) |
539 | tty_port_tty_hangup(&port->port, true); | 543 | tty_port_tty_hangup(&port->port, true); |
540 | 544 | resubmit: | |
541 | /* Resubmit urb so we continue receiving */ | 545 | /* Resubmit urb so we continue receiving */ |
542 | err = usb_submit_urb(urb, GFP_ATOMIC); | 546 | err = usb_submit_urb(urb, GFP_ATOMIC); |
543 | if (err != 0) | 547 | if (err != 0) |
@@ -607,6 +611,8 @@ static void usa49_instat_callback(struct urb *urb) | |||
607 | } | 611 | } |
608 | port = serial->port[msg->portNumber]; | 612 | port = serial->port[msg->portNumber]; |
609 | p_priv = usb_get_serial_port_data(port); | 613 | p_priv = usb_get_serial_port_data(port); |
614 | if (!p_priv) | ||
615 | goto resubmit; | ||
610 | 616 | ||
611 | /* Update handshaking pin state information */ | 617 | /* Update handshaking pin state information */ |
612 | old_dcd_state = p_priv->dcd_state; | 618 | old_dcd_state = p_priv->dcd_state; |
@@ -617,7 +623,7 @@ static void usa49_instat_callback(struct urb *urb) | |||
617 | 623 | ||
618 | if (old_dcd_state != p_priv->dcd_state && old_dcd_state) | 624 | if (old_dcd_state != p_priv->dcd_state && old_dcd_state) |
619 | tty_port_tty_hangup(&port->port, true); | 625 | tty_port_tty_hangup(&port->port, true); |
620 | 626 | resubmit: | |
621 | /* Resubmit urb so we continue receiving */ | 627 | /* Resubmit urb so we continue receiving */ |
622 | err = usb_submit_urb(urb, GFP_ATOMIC); | 628 | err = usb_submit_urb(urb, GFP_ATOMIC); |
623 | if (err != 0) | 629 | if (err != 0) |
@@ -855,6 +861,8 @@ static void usa90_instat_callback(struct urb *urb) | |||
855 | 861 | ||
856 | port = serial->port[0]; | 862 | port = serial->port[0]; |
857 | p_priv = usb_get_serial_port_data(port); | 863 | p_priv = usb_get_serial_port_data(port); |
864 | if (!p_priv) | ||
865 | goto resubmit; | ||
858 | 866 | ||
859 | /* Update handshaking pin state information */ | 867 | /* Update handshaking pin state information */ |
860 | old_dcd_state = p_priv->dcd_state; | 868 | old_dcd_state = p_priv->dcd_state; |
@@ -865,7 +873,7 @@ static void usa90_instat_callback(struct urb *urb) | |||
865 | 873 | ||
866 | if (old_dcd_state != p_priv->dcd_state && old_dcd_state) | 874 | if (old_dcd_state != p_priv->dcd_state && old_dcd_state) |
867 | tty_port_tty_hangup(&port->port, true); | 875 | tty_port_tty_hangup(&port->port, true); |
868 | 876 | resubmit: | |
869 | /* Resubmit urb so we continue receiving */ | 877 | /* Resubmit urb so we continue receiving */ |
870 | err = usb_submit_urb(urb, GFP_ATOMIC); | 878 | err = usb_submit_urb(urb, GFP_ATOMIC); |
871 | if (err != 0) | 879 | if (err != 0) |
@@ -926,6 +934,8 @@ static void usa67_instat_callback(struct urb *urb) | |||
926 | 934 | ||
927 | port = serial->port[msg->port]; | 935 | port = serial->port[msg->port]; |
928 | p_priv = usb_get_serial_port_data(port); | 936 | p_priv = usb_get_serial_port_data(port); |
937 | if (!p_priv) | ||
938 | goto resubmit; | ||
929 | 939 | ||
930 | /* Update handshaking pin state information */ | 940 | /* Update handshaking pin state information */ |
931 | old_dcd_state = p_priv->dcd_state; | 941 | old_dcd_state = p_priv->dcd_state; |
@@ -934,7 +944,7 @@ static void usa67_instat_callback(struct urb *urb) | |||
934 | 944 | ||
935 | if (old_dcd_state != p_priv->dcd_state && old_dcd_state) | 945 | if (old_dcd_state != p_priv->dcd_state && old_dcd_state) |
936 | tty_port_tty_hangup(&port->port, true); | 946 | tty_port_tty_hangup(&port->port, true); |
937 | 947 | resubmit: | |
938 | /* Resubmit urb so we continue receiving */ | 948 | /* Resubmit urb so we continue receiving */ |
939 | err = usb_submit_urb(urb, GFP_ATOMIC); | 949 | err = usb_submit_urb(urb, GFP_ATOMIC); |
940 | if (err != 0) | 950 | if (err != 0) |