Hi:
The kaweth driver kills the URBs in kaweth_disconnect() as well as
kaweth_close(). The former is unnecessary because as part of the
netdev deregistration dev_close() will be called if the interface
is up which ends up calling kaweth_close().
If the interface isn't up then no URBs should be active.
Similarly, once kaweth_close() calls netif_stop_queue() no further
calls to kaweth_start_xmit() will be made. Therefore it is not
needed for it to check kaweth->removed.
The following patch removes these unnecessary code.
Signed-off-by: Herbert Xu <[EMAIL PROTECTED]>
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
diff --git a/drivers/usb/net/kaweth.c b/drivers/usb/net/kaweth.c
--- a/drivers/usb/net/kaweth.c
+++ b/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;
@@ -750,13 +749,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 +1128,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);