diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 3beb6a862e80..dd037dc4cb37 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -2605,7 +2605,8 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, if (!(file->f_mode & FMODE_WRITE)) return -EPERM; - usb_lock_device(dev); + if (!usb_trylock_device(dev)) + return -EBUSY; /* Reap operations are allowed even after disconnection */ switch (cmd) {