diff options
Diffstat (limited to 'drivers/usb/core/sysfs.c')
-rw-r--r-- | drivers/usb/core/sysfs.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c index 15477008b631..485edf937f25 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c | |||
@@ -82,9 +82,13 @@ static ssize_t show_##name(struct device *dev, \ | |||
82 | struct device_attribute *attr, char *buf) \ | 82 | struct device_attribute *attr, char *buf) \ |
83 | { \ | 83 | { \ |
84 | struct usb_device *udev; \ | 84 | struct usb_device *udev; \ |
85 | int retval; \ | ||
85 | \ | 86 | \ |
86 | udev = to_usb_device(dev); \ | 87 | udev = to_usb_device(dev); \ |
87 | return sprintf(buf, "%s\n", udev->name); \ | 88 | usb_lock_device(udev); \ |
89 | retval = sprintf(buf, "%s\n", udev->name); \ | ||
90 | usb_unlock_device(udev); \ | ||
91 | return retval; \ | ||
88 | } \ | 92 | } \ |
89 | static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL); | 93 | static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL); |
90 | 94 | ||