Hi,
this patch removes an SMP deadlock, removes an nfs deadlock, fixes a
mem leak should the firmware not be loaded and does a few cleanups.
I'll do more changes after Brad has sent me the device.
It applies to 2.5.3. I'll do a patch against 2.4 as soon as I've established
a 2.4 tree on this box, probably tomorrow.
Regards
Oliver
--- kaweth.c.alt Sat Feb 2 10:59:01 2002
+++ kaweth.c Sat Feb 2 12:27:26 2002
@@ -155,6 +155,7 @@
* kaweth_driver
****************************************************************/
static struct usb_driver kaweth_driver = {
+ owner: THIS_MODULE,
name: "kaweth",
probe: kaweth_probe,
disconnect: kaweth_disconnect,
@@ -238,8 +239,7 @@
return -EBUSY;
}
- dr = kmalloc(sizeof(struct usb_ctrlrequest),
- in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
+ dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC);
if (!dr) {
kaweth_dbg("kmalloc() failed");
@@ -586,14 +586,10 @@
{
struct kaweth_device *kaweth = urb->context;
- spin_lock(&kaweth->device_lock);
-
- if (urb->status)
+ if (unlikely(urb->status != 0))
kaweth_dbg("%s: TX status %d.", kaweth->net->name, urb->status);
netif_wake_queue(kaweth->net);
-
- spin_unlock(&kaweth->device_lock);
}
/****************************************************************
@@ -757,9 +753,7 @@
memset(kaweth, 0, sizeof(struct kaweth_device));
kaweth->dev = dev;
- kaweth->status = 0;
- kaweth->net = NULL;
- kaweth->device_lock = SPIN_LOCK_UNLOCKED;
+ spin_lock_init(&kaweth->device_lock);
kaweth_dbg("Resetting.");
@@ -824,6 +818,7 @@
/* Device will now disappear for a moment... */
kaweth_info("Firmware loaded. I'll be back...");
+ kfree(kaweth);
return NULL;
}
@@ -925,6 +920,8 @@
kaweth_warn("unregistering non-existant device");
return;
}
+ usb_unlink_urb(kaweth->tx_urb);
+ usb_unlink_urb(kaweth->rx_urb);
if(kaweth->net) {
if(kaweth->net->flags & IFF_UP) {
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel