aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/net
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2005-11-17 12:47:45 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-17 14:29:54 -0500
commitd23b536bb715673ca0ccbdaac2b6ce2c001d06e9 (patch)
treeea784d44ab72378b716c084f79926e4435eea046 /drivers/usb/net
parent8845add380854ffce5268714a093df8c80b4a6e2 (diff)
[PATCH] USB: fix race in kaweth disconnect
this patch from Herbert Xu fixes a race by moving termination of the URBs into close() exclusively. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Oliver Neukum <oliver@neukum.name> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/usb/net')
-rw-r--r--drivers/usb/net/kaweth.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/usb/net/kaweth.c b/drivers/usb/net/kaweth.c
index 6bef1be6b36c..b5776518020f 100644
--- a/drivers/usb/net/kaweth.c
+++ b/drivers/usb/net/kaweth.c
@@ -219,7 +219,6 @@ struct kaweth_device
219 219
220 __u32 status; 220 __u32 status;
221 int end; 221 int end;
222 int removed;
223 int suspend_lowmem_rx; 222 int suspend_lowmem_rx;
224 int suspend_lowmem_ctrl; 223 int suspend_lowmem_ctrl;
225 int linkstate; 224 int linkstate;
@@ -699,6 +698,7 @@ static int kaweth_close(struct net_device *net)
699 698
700 usb_kill_urb(kaweth->irq_urb); 699 usb_kill_urb(kaweth->irq_urb);
701 usb_kill_urb(kaweth->rx_urb); 700 usb_kill_urb(kaweth->rx_urb);
701 usb_kill_urb(kaweth->tx_urb);
702 702
703 flush_scheduled_work(); 703 flush_scheduled_work();
704 704
@@ -750,13 +750,6 @@ static int kaweth_start_xmit(struct sk_buff *skb, struct net_device *net)
750 750
751 spin_lock(&kaweth->device_lock); 751 spin_lock(&kaweth->device_lock);
752 752
753 if (kaweth->removed) {
754 /* our device is undergoing disconnection - we bail out */
755 spin_unlock(&kaweth->device_lock);
756 dev_kfree_skb_irq(skb);
757 return 0;
758 }
759
760 kaweth_async_set_rx_mode(kaweth); 753 kaweth_async_set_rx_mode(kaweth);
761 netif_stop_queue(net); 754 netif_stop_queue(net);
762 755
@@ -1136,10 +1129,6 @@ static void kaweth_disconnect(struct usb_interface *intf)
1136 return; 1129 return;
1137 } 1130 }
1138 netdev = kaweth->net; 1131 netdev = kaweth->net;
1139 kaweth->removed = 1;
1140 usb_kill_urb(kaweth->irq_urb);
1141 usb_kill_urb(kaweth->rx_urb);
1142 usb_kill_urb(kaweth->tx_urb);
1143 1132
1144 kaweth_dbg("Unregistering net device"); 1133 kaweth_dbg("Unregistering net device");
1145 unregister_netdev(netdev); 1134 unregister_netdev(netdev);