From: Herbert Xu <[EMAIL PROTECTED]>

this patch from Herbert Xu fixes a race by moving termination of
the URBs into close() exclusively.

Signed-off-by: Herbert Xu <[EMAIL PROTECTED]>
Signed-off-by: Oliver Neukum <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>

---
 drivers/usb/net/kaweth.c |   13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

--- usb-2.6.orig/drivers/usb/net/kaweth.c
+++ usb-2.6/drivers/usb/net/kaweth.c
@@ -219,7 +219,6 @@ struct kaweth_device
 
        __u32 status;
        int end;
-       int removed;
        int suspend_lowmem_rx;
        int suspend_lowmem_ctrl;
        int linkstate;
@@ -699,6 +698,7 @@ static int kaweth_close(struct net_devic
 
        usb_kill_urb(kaweth->irq_urb);
        usb_kill_urb(kaweth->rx_urb);
+       usb_kill_urb(kaweth->tx_urb);
 
        flush_scheduled_work();
 
@@ -750,13 +750,6 @@ static int kaweth_start_xmit(struct sk_b
 
        spin_lock(&kaweth->device_lock);
 
-       if (kaweth->removed) {
-       /* our device is undergoing disconnection - we bail out */
-               spin_unlock(&kaweth->device_lock);
-               dev_kfree_skb_irq(skb);
-               return 0;
-       }
-
        kaweth_async_set_rx_mode(kaweth);
        netif_stop_queue(net);
 
@@ -1136,10 +1129,6 @@ static void kaweth_disconnect(struct usb
                return;
        }
        netdev = kaweth->net;
-       kaweth->removed = 1;
-       usb_kill_urb(kaweth->irq_urb);
-       usb_kill_urb(kaweth->rx_urb);
-       usb_kill_urb(kaweth->tx_urb);
 
        kaweth_dbg("Unregistering net device");
        unregister_netdev(netdev);

--


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to