diff options
Diffstat (limited to 'drivers/usb/misc/usbled.c')
-rw-r--r-- | drivers/usb/misc/usbled.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/misc/usbled.c b/drivers/usb/misc/usbled.c index 49c5c5c4c431..06cb71942dc7 100644 --- a/drivers/usb/misc/usbled.c +++ b/drivers/usb/misc/usbled.c | |||
@@ -144,12 +144,14 @@ static void led_disconnect(struct usb_interface *interface) | |||
144 | struct usb_led *dev; | 144 | struct usb_led *dev; |
145 | 145 | ||
146 | dev = usb_get_intfdata (interface); | 146 | dev = usb_get_intfdata (interface); |
147 | usb_set_intfdata (interface, NULL); | ||
148 | 147 | ||
149 | device_remove_file(&interface->dev, &dev_attr_blue); | 148 | device_remove_file(&interface->dev, &dev_attr_blue); |
150 | device_remove_file(&interface->dev, &dev_attr_red); | 149 | device_remove_file(&interface->dev, &dev_attr_red); |
151 | device_remove_file(&interface->dev, &dev_attr_green); | 150 | device_remove_file(&interface->dev, &dev_attr_green); |
152 | 151 | ||
152 | /* first remove the files, then set the pointer to NULL */ | ||
153 | usb_set_intfdata (interface, NULL); | ||
154 | |||
153 | usb_put_dev(dev->udev); | 155 | usb_put_dev(dev->udev); |
154 | 156 | ||
155 | kfree(dev); | 157 | kfree(dev); |