diff options
| author | 2020-09-14 10:10:55 +0200 | |
|---|---|---|
| committer | 2020-09-14 10:10:55 +0200 | |
| commit | fccee0baced04636952cd580ddee4bb8cbb9544c (patch) | |
| tree | 80e25c0e100246357bd0c0a93feb1bf2e5e5bd1d /drivers/usb/core/sysfs.c | |
| parent | usb: typec: intel_pmc_mux: Support for device role (UFP) (diff) | |
| parent | Linux 5.9-rc5 (diff) | |
| download | wireguard-linux-fccee0baced04636952cd580ddee4bb8cbb9544c.tar.xz wireguard-linux-fccee0baced04636952cd580ddee4bb8cbb9544c.zip | |
Merge 5.9-rc5 into usb-next
We need the USB fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core/sysfs.c')
| -rw-r--r-- | drivers/usb/core/sysfs.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c index a2ca38e25e0c..8d134193fa0c 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c @@ -889,7 +889,11 @@ read_descriptors(struct file *filp, struct kobject *kobj, size_t srclen, n; int cfgno; void *src; + int retval; + retval = usb_lock_device_interruptible(udev); + if (retval < 0) + return -EINTR; /* The binary attribute begins with the device descriptor. * Following that are the raw descriptor entries for all the * configurations (config plus subsidiary descriptors). @@ -914,6 +918,7 @@ read_descriptors(struct file *filp, struct kobject *kobj, off -= srclen; } } + usb_unlock_device(udev); return count - nleft; } |
