mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
4edf2c8363
commit
949ce47168
1 changed files with 3 additions and 1 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue