--- local_tree.orig/drivers/usb/core/devio.c    2004-07-26 00:34:29.602731436 +0200
+++ local_tree/drivers/usb/core/devio.c 2004-07-26 00:39:13.980826658 +0200
@@ -1168,10 +1168,17 @@
 
        if (get_user(ifnum, (unsigned int __user *)arg))
                return -EFAULT;
-       if ((ret = releaseintf(ps, ifnum)) < 0)
-               return ret;
+       down(&ps->dev->serialize);
+       if (!connected(ps->dev)) {
+               ret = -ENODEV;
+               goto out;
+       }
+       if ((ret = releaseintf(ps, ifnum)))
+               goto out;
        destroy_async_on_interface (ps, ifnum);
-       return 0;
+out:
+       up(&ps->dev->serialize);
+       return ret;
 }
 
 static int proc_ioctl (struct dev_state *ps, void __user *arg)
@@ -1374,14 +1381,8 @@
                break;
 
        case USBDEVFS_RELEASEINTERFACE:
-               down(&dev->serialize);
-               if (!connected(dev)) {
-                       up(&dev->serialize);
-                       return -ENODEV;
-               }
                snoop(&dev->dev, "%s: RELEASEINTERFACE\n", __FUNCTION__);
                ret = proc_releaseinterface(ps, p);
-               up(&dev->serialize);
                break;
 
        case USBDEVFS_IOCTL:


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