summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.de>2007-03-30 10:52:16 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2007-04-27 13:28:38 -0700
commit949ce47168a34618c3e24cb7dd4ab52233a4653c (patch)
tree5739777b78057b04ba77e85bada13a693746b616 /drivers/usb
parent4edf2c83637b9e9db771cc5629de036fe4488564 (diff)
USB: cypress_cy7c63: race disconnect/sysfs read-write leading to following NULL pointer
this driver sets intfdata to NULL while it still can be read and happily followed. Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/misc/cypress_cy7c63.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/misc/cypress_cy7c63.c b/drivers/usb/misc/cypress_cy7c63.c
index b63b5f34b2aa..d721380b242d 100644
--- a/drivers/usb/misc/cypress_cy7c63.c
+++ b/drivers/usb/misc/cypress_cy7c63.c
@@ -246,11 +246,13 @@ static void cypress_disconnect(struct usb_interface *interface)
struct cypress *dev;
dev = usb_get_intfdata(interface);
- usb_set_intfdata(interface, NULL);
/* remove device attribute files */
device_remove_file(&interface->dev, &dev_attr_port0);
device_remove_file(&interface->dev, &dev_attr_port1);
+ /* the intfdata can be set to NULL only after the
+ * device files have been removed */
+ usb_set_intfdata(interface, NULL);
usb_put_dev(dev->udev);