--- local_tree.orig/drivers/usb/core/devio.c 2004-07-25 23:49:54.978689141 +0200
+++ local_tree/drivers/usb/core/devio.c 2004-07-26 00:08:48.470761404 +0200
@@ -1010,12 +1010,21 @@
static int proc_unlinkurb(struct dev_state *ps, void __user *arg)
{
struct async *as;
+ struct usb_device *dev = ps->dev;
+ int ret = 0;
- as = async_getpending(ps, arg);
- if (!as)
- return -EINVAL;
- usb_unlink_urb(as->urb);
- return 0;
+ down(&dev->serialize);
+ if (!connected(dev)) {
+ ret = -ENODEV;
+ goto out;
+ }
+ if ((as = async_getpending(ps, arg)))
+ usb_unlink_urb(as->urb);
+ else
+ ret = -EINVAL;
+out:
+ up(&dev->serialize);
+ return ret;
}
static int processcompl(struct async *as)
@@ -1311,14 +1320,8 @@
break;
case USBDEVFS_DISCARDURB:
- down(&dev->serialize);
- if (!connected(dev)) {
- up(&dev->serialize);
- return -ENODEV;
- }
snoop(&dev->dev, "%s: DISCARDURB\n", __FUNCTION__);
ret = proc_unlinkurb(ps, p);
- up(&dev->serialize);
break;
case USBDEVFS_REAPURB:
-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel