USB: fix transvibrator disconnect race
in disconnect you set the interface's private data to NULL. In your IO methods you unconditionally follow the pointer into never never land. Signed-off-by: Oliver Neukum <oliver@neukum.name> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
6a7255e1df
commit
96ca014d53
|
@ -120,8 +120,8 @@ static void tv_disconnect(struct usb_interface *interface)
|
||||||
struct trancevibrator *dev;
|
struct trancevibrator *dev;
|
||||||
|
|
||||||
dev = usb_get_intfdata (interface);
|
dev = usb_get_intfdata (interface);
|
||||||
usb_set_intfdata(interface, NULL);
|
|
||||||
device_remove_file(&interface->dev, &dev_attr_speed);
|
device_remove_file(&interface->dev, &dev_attr_speed);
|
||||||
|
usb_set_intfdata(interface, NULL);
|
||||||
usb_put_dev(dev->udev);
|
usb_put_dev(dev->udev);
|
||||||
kfree(dev);
|
kfree(dev);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue