--- local_tree.orig/drivers/usb/core/devio.c 2004-07-26 00:31:47.183662802 +0200
+++ local_tree/drivers/usb/core/devio.c 2004-07-26 00:34:29.602731436 +0200
@@ -1148,10 +1148,17 @@
static int proc_claiminterface(struct dev_state *ps, void __user *arg)
{
unsigned int ifnum;
+ int ret;
if (get_user(ifnum, (unsigned int __user *)arg))
return -EFAULT;
- return claimintf(ps, ifnum);
+ down(&ps->dev->serialize);
+ if (!connected(ps->dev))
+ ret = -ENODEV;
+ else
+ ret = claimintf(ps, ifnum);
+ up(&ps->dev->serialize);
+ return ret;
}
static int proc_releaseinterface(struct dev_state *ps, void __user *arg)
@@ -1362,14 +1369,8 @@
break;
case USBDEVFS_CLAIMINTERFACE:
- down(&dev->serialize);
- if (!connected(dev)) {
- up(&dev->serialize);
- return -ENODEV;
- }
snoop(&dev->dev, "%s: CLAIMINTERFACE\n", __FUNCTION__);
ret = proc_claiminterface(ps, p);
- up(&dev->serialize);
break;
case USBDEVFS_RELEASEINTERFACE:
-------------------------------------------------------
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