USB: fix transvibrator disconnect race
authorOliver Neukum <oliver@neukum.name>
Fri, 24 Nov 2006 11:55:59 +0000 (12:55 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 20 Dec 2006 18:13:23 +0000 (10:13 -0800)
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>
drivers/usb/misc/trancevibrator.c

index 33cd91d11ecaab107c3afb67ba6bada07b0d22e1..67e2fc20eeeb29d8381dddea4588318630725273 100644 (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);
 }