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:
Oliver Neukum 2006-11-24 12:55:59 +01:00 committed by Greg Kroah-Hartman
parent 6a7255e1df
commit 96ca014d53

View File

@ -120,8 +120,8 @@ static void tv_disconnect(struct usb_interface *interface)
struct trancevibrator *dev;
dev = usb_get_intfdata (interface);
usb_set_intfdata(interface, NULL);
device_remove_file(&interface->dev, &dev_attr_speed);
usb_set_intfdata(interface, NULL);
usb_put_dev(dev->udev);
kfree(dev);
}