From 96ca014d53d2c2f9d3b32fe6f2f003e660c3bc63 Mon Sep 17 00:00:00 2001
From: Oliver Neukum <oliver@neukum.name>
Date: Fri, 24 Nov 2006 12:55:59 +0100
Subject: [PATCH] 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>
---
 drivers/usb/misc/trancevibrator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/misc/trancevibrator.c b/drivers/usb/misc/trancevibrator.c
index 33cd91d11ecaa..67e2fc20eeeb2 100644
--- a/drivers/usb/misc/trancevibrator.c
+++ b/drivers/usb/misc/trancevibrator.c
@@ -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);
 }
-- 
GitLab