if (!(file->f_mode & FMODE_WRITE))
return -EPERM;
+
+ lock_kernel();
usb_lock_device(dev);
if (!connected(ps)) {
usb_unlock_device(dev);
+ unlock_kernel();
return -ENODEV;
}
break;
case USBDEVFS_SUBMITURB:
+ unlock_kernel();
snoop(&dev->dev, "%s: SUBMITURB\n", __func__);
ret = proc_submiturb(ps, p);
if (ret >= 0)
inode->i_mtime = CURRENT_TIME;
+ lock_kernel();
break;
#ifdef CONFIG_COMPAT
break;
case USBDEVFS_REAPURB:
+ unlock_kernel();
snoop(&dev->dev, "%s: REAPURB\n", __func__);
ret = proc_reapurb(ps, p);
+ lock_kernel();
break;
case USBDEVFS_REAPURBNDELAY:
+ unlock_kernel();
snoop(&dev->dev, "%s: REAPURBNDELAY\n", __func__);
ret = proc_reapurbnonblock(ps, p);
+ lock_kernel();
break;
case USBDEVFS_DISCSIGNAL:
break;
}
usb_unlock_device(dev);
+ unlock_kernel();
if (ret >= 0)
inode->i_atime = CURRENT_TIME;
return ret;
{
int ret;
- lock_kernel();
ret = usbdev_do_ioctl(file, cmd, (void __user *)arg);
- unlock_kernel();
return ret;
}
{
int ret;
- lock_kernel();
ret = usbdev_do_ioctl(file, cmd, compat_ptr(arg));
- unlock_kernel();
return ret;
}