diff options
Diffstat (limited to 'drivers/usb/core/sysfs.c')
-rw-r--r-- | drivers/usb/core/sysfs.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c index 1b3c00b3ca3..d8f3bfe1559 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c @@ -352,6 +352,7 @@ set_autosuspend(struct device *dev, struct device_attribute *attr, return -EINVAL; value *= HZ; + usb_lock_device(udev); udev->autosuspend_delay = value; if (value >= 0) usb_try_autosuspend_device(udev); @@ -359,6 +360,7 @@ set_autosuspend(struct device *dev, struct device_attribute *attr, if (usb_autoresume_device(udev) == 0) usb_autosuspend_device(udev); } + usb_unlock_device(udev); return count; } |