> Anyway I attached the new patch to this mail, could you please apply it?
>
> Description: Driver for ZyDAS zd1201 based usb wireless adapters.
+ urb = kmalloc(sizeof(struct urb), GFP_ATOMIC);
+ if (!urb) {
+ kfree(command);
+ return -ENOMEM;
+ }
+ usb_init_urb(urb);
Please use the usb allocation method.
+ switch(urb->status) {
+ case -EILSEQ:
+ case -ENODEV:
+ case -ETIMEDOUT:
+ case -ENOENT:
+ case -EPIPE:
+ case -EOVERFLOW:
You must test for ESHUTDOWN, too, or cardbus will break horribly.
+ max = zd2host16(max);
+ for (i=0; i<max; i++) {
+ if ((err = zd1201_docmd(zd, ZD1201_CMDCODE_ALLOC, 1514, 0, 0)))
+ goto err_urb;
+ }
+
+ return 0;
+
+err_urb:
+ usb_kill_urb(&zd->rx_urb);
+ return err;
usb_kill_urb() will sleep. There's something wrong with atomicity here.
+static void zd1201_tx_timeout(struct net_device *dev)
+{
+ struct zd1201 *zd = (struct zd1201 *)dev->priv;
+
+ if (!zd)
+ return;
+ dev_warn(&zd->usb->dev, "%s: TX timeout, shooting down urb\n",
+ dev->name);
+ zd->tx_urb.transfer_flags |= URB_ASYNC_UNLINK;
+ usb_unlink_urb(&zd->tx_urb);
+ zd->stats.tx_errors++;
+ /* Restart the timeout to quiet the watchdog: */
+ dev->trans_start = jiffies;
+ /* Restart the net queue: */
+ netif_wake_queue(dev);
+}
This is a race condition. By restarting the queue you may submit
an URB that hasn't been unlinked.
Regards
Oliver
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel