diff options
-rw-r--r-- | drivers/usb/misc/cytherm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/misc/cytherm.c b/drivers/usb/misc/cytherm.c index 2677fea147d9..1cd9e7eba93b 100644 --- a/drivers/usb/misc/cytherm.c +++ b/drivers/usb/misc/cytherm.c | |||
@@ -399,7 +399,6 @@ static void cytherm_disconnect(struct usb_interface *interface) | |||
399 | struct usb_cytherm *dev; | 399 | struct usb_cytherm *dev; |
400 | 400 | ||
401 | dev = usb_get_intfdata (interface); | 401 | dev = usb_get_intfdata (interface); |
402 | usb_set_intfdata (interface, NULL); | ||
403 | 402 | ||
404 | device_remove_file(&interface->dev, &dev_attr_brightness); | 403 | device_remove_file(&interface->dev, &dev_attr_brightness); |
405 | device_remove_file(&interface->dev, &dev_attr_temp); | 404 | device_remove_file(&interface->dev, &dev_attr_temp); |
@@ -407,6 +406,9 @@ static void cytherm_disconnect(struct usb_interface *interface) | |||
407 | device_remove_file(&interface->dev, &dev_attr_port0); | 406 | device_remove_file(&interface->dev, &dev_attr_port0); |
408 | device_remove_file(&interface->dev, &dev_attr_port1); | 407 | device_remove_file(&interface->dev, &dev_attr_port1); |
409 | 408 | ||
409 | /* first remove the files, then NULL the pointer */ | ||
410 | usb_set_intfdata (interface, NULL); | ||
411 | |||
410 | usb_put_dev(dev->udev); | 412 | usb_put_dev(dev->udev); |
411 | 413 | ||
412 | kfree(dev); | 414 | kfree(dev); |