aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/hso.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/usb/hso.c')
-rw-r--r--drivers/net/usb/hso.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 43bc3fcc0d85..f78f0903b073 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -602,9 +602,9 @@ static struct hso_serial *get_serial_by_shared_int_and_type(
602 port = hso_mux_to_port(mux); 602 port = hso_mux_to_port(mux);
603 603
604 for (i = 0; i < HSO_SERIAL_TTY_MINORS; i++) { 604 for (i = 0; i < HSO_SERIAL_TTY_MINORS; i++) {
605 if (serial_table[i] 605 if (serial_table[i] &&
606 && (dev2ser(serial_table[i])->shared_int == shared_int) 606 (dev2ser(serial_table[i])->shared_int == shared_int) &&
607 && ((serial_table[i]->port_spec & HSO_PORT_MASK) == port)) { 607 ((serial_table[i]->port_spec & HSO_PORT_MASK) == port)) {
608 return dev2ser(serial_table[i]); 608 return dev2ser(serial_table[i]);
609 } 609 }
610 } 610 }
@@ -846,8 +846,8 @@ static void hso_net_tx_timeout(struct net_device *net)
846 dev_warn(&net->dev, "Tx timed out.\n"); 846 dev_warn(&net->dev, "Tx timed out.\n");
847 847
848 /* Tear the waiting frame off the list */ 848 /* Tear the waiting frame off the list */
849 if (odev->mux_bulk_tx_urb 849 if (odev->mux_bulk_tx_urb &&
850 && (odev->mux_bulk_tx_urb->status == -EINPROGRESS)) 850 (odev->mux_bulk_tx_urb->status == -EINPROGRESS))
851 usb_unlink_urb(odev->mux_bulk_tx_urb); 851 usb_unlink_urb(odev->mux_bulk_tx_urb);
852 852
853 /* Update statistics */ 853 /* Update statistics */
@@ -1020,9 +1020,9 @@ static void read_bulk_callback(struct urb *urb)
1020 u32 rest; 1020 u32 rest;
1021 u8 crc_check[4] = { 0xDE, 0xAD, 0xBE, 0xEF }; 1021 u8 crc_check[4] = { 0xDE, 0xAD, 0xBE, 0xEF };
1022 rest = urb->actual_length % odev->in_endp->wMaxPacketSize; 1022 rest = urb->actual_length % odev->in_endp->wMaxPacketSize;
1023 if (((rest == 5) || (rest == 6)) 1023 if (((rest == 5) || (rest == 6)) &&
1024 && !memcmp(((u8 *) urb->transfer_buffer) + 1024 !memcmp(((u8 *) urb->transfer_buffer) +
1025 urb->actual_length - 4, crc_check, 4)) { 1025 urb->actual_length - 4, crc_check, 4)) {
1026 urb->actual_length -= 4; 1026 urb->actual_length -= 4;
1027 } 1027 }
1028 } 1028 }
@@ -1226,9 +1226,9 @@ static void hso_std_serial_read_bulk_callback(struct urb *urb)
1226 rest = 1226 rest =
1227 urb->actual_length % 1227 urb->actual_length %
1228 serial->in_endp->wMaxPacketSize; 1228 serial->in_endp->wMaxPacketSize;
1229 if (((rest == 5) || (rest == 6)) 1229 if (((rest == 5) || (rest == 6)) &&
1230 && !memcmp(((u8 *) urb->transfer_buffer) + 1230 !memcmp(((u8 *) urb->transfer_buffer) +
1231 urb->actual_length - 4, crc_check, 4)) { 1231 urb->actual_length - 4, crc_check, 4)) {
1232 urb->actual_length -= 4; 1232 urb->actual_length -= 4;
1233 } 1233 }
1234 } 1234 }
@@ -2982,8 +2982,8 @@ static int hso_probe(struct usb_interface *interface,
2982 2982
2983 case HSO_INTF_BULK: 2983 case HSO_INTF_BULK:
2984 /* It's a regular bulk interface */ 2984 /* It's a regular bulk interface */
2985 if (((port_spec & HSO_PORT_MASK) == HSO_PORT_NETWORK) 2985 if (((port_spec & HSO_PORT_MASK) == HSO_PORT_NETWORK) &&
2986 && !disable_net) 2986 !disable_net)
2987 hso_dev = hso_create_net_device(interface, port_spec); 2987 hso_dev = hso_create_net_device(interface, port_spec);
2988 else 2988 else
2989 hso_dev = 2989 hso_dev =
@@ -3146,8 +3146,8 @@ static void hso_free_interface(struct usb_interface *interface)
3146 int i; 3146 int i;
3147 3147
3148 for (i = 0; i < HSO_SERIAL_TTY_MINORS; i++) { 3148 for (i = 0; i < HSO_SERIAL_TTY_MINORS; i++) {
3149 if (serial_table[i] 3149 if (serial_table[i] &&
3150 && (serial_table[i]->interface == interface)) { 3150 (serial_table[i]->interface == interface)) {
3151 hso_dev = dev2ser(serial_table[i]); 3151 hso_dev = dev2ser(serial_table[i]);
3152 spin_lock_irq(&hso_dev->serial_lock); 3152 spin_lock_irq(&hso_dev->serial_lock);
3153 tty = tty_kref_get(hso_dev->tty); 3153 tty = tty_kref_get(hso_dev->tty);
@@ -3163,8 +3163,8 @@ static void hso_free_interface(struct usb_interface *interface)
3163 } 3163 }
3164 3164
3165 for (i = 0; i < HSO_MAX_NET_DEVICES; i++) { 3165 for (i = 0; i < HSO_MAX_NET_DEVICES; i++) {
3166 if (network_table[i] 3166 if (network_table[i] &&
3167 && (network_table[i]->interface == interface)) { 3167 (network_table[i]->interface == interface)) {
3168 struct rfkill *rfk = dev2net(network_table[i])->rfkill; 3168 struct rfkill *rfk = dev2net(network_table[i])->rfkill;
3169 /* hso_stop_net_device doesn't stop the net queue since 3169 /* hso_stop_net_device doesn't stop the net queue since
3170 * traffic needs to start it again when suspended */ 3170 * traffic needs to start it again when suspended */