--- local_tree.orig/drivers/usb/core/devio.c    2004-07-25 14:37:18.758596644 +0200
+++ local_tree/drivers/usb/core/devio.c 2004-07-25 14:38:38.768837204 +0200
@@ -654,17 +654,25 @@
 
 static int proc_resetep(struct dev_state *ps, void __user *arg)
 {
+       struct usb_device *dev = ps->dev;
        unsigned int ep;
        int ret;
 
        if (get_user(ep, (unsigned int __user *)arg))
                return -EFAULT;
+       down(&dev->serialize);
+       if (!connected(dev)) {
+               ret = -ENODEV;
+               goto out;
+       }
        if ((ret = findintfep(ps->dev, ep)) < 0)
-               return ret;
+               goto out;
        if ((ret = checkintf(ps, ret)))
-               return ret;
+               goto out;
        usb_settoggle(ps->dev, ep & 0xf, !(ep & USB_DIR_IN), 0);
-       return 0;
+out:
+       up(&dev->serialize);
+       return ret;
 }
 
 static int proc_clearhalt(struct dev_state *ps, void __user *arg)
@@ -1209,16 +1217,10 @@
                break;
 
        case USBDEVFS_RESETEP:
-               down(&dev->serialize);
-               if (!connected(dev)) {
-                       up(&dev->serialize);
-                       return -ENODEV;
-               }
                snoop(&dev->dev, "%s: RESETEP\n", __FUNCTION__);
                ret = proc_resetep(ps, p);
                if (ret >= 0)
                        inode->i_mtime = CURRENT_TIME;
-               up(&dev->serialize);
                break;
 
        case USBDEVFS_RESET:


-------------------------------------------------------
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

Reply via email to