diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-04-30 05:12:05 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-04-30 05:12:05 -0700 |
commit | 03420865e10d05d60d592fe8649e4853dc69ca5a (patch) | |
tree | 105d173e5267931d794e429ee7c64f83e526a521 /drivers/usb/usbip/stub_main.c | |
parent | a2e63709b53312002009c564460af34520c62f98 (diff) | |
parent | 6da6c0db5316275015e8cc2959f12a17584aeb64 (diff) | |
download | blackbird-op-linux-03420865e10d05d60d592fe8649e4853dc69ca5a.tar.gz blackbird-op-linux-03420865e10d05d60d592fe8649e4853dc69ca5a.zip |
Merge 4.17-rc3 into staging-next
We want the staging fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/usbip/stub_main.c')
-rw-r--r-- | drivers/usb/usbip/stub_main.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/usbip/stub_main.c b/drivers/usb/usbip/stub_main.c index c31c8402a0c5..d41d0cdeec0f 100644 --- a/drivers/usb/usbip/stub_main.c +++ b/drivers/usb/usbip/stub_main.c @@ -186,7 +186,12 @@ static ssize_t rebind_store(struct device_driver *dev, const char *buf, if (!bid) return -ENODEV; + /* device_attach() callers should hold parent lock for USB */ + if (bid->udev->dev.parent) + device_lock(bid->udev->dev.parent); ret = device_attach(&bid->udev->dev); + if (bid->udev->dev.parent) + device_unlock(bid->udev->dev.parent); if (ret < 0) { dev_err(&bid->udev->dev, "rebind failed\n"); return ret; |