Commit dc7b9e49 authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman

[PATCH] usage count handling during disconnect

in usb.c during disconnect handling a reference to a driver is passed
after the module usage count is decremented. In theory this is a race.
parent 1feeeb01
...@@ -1899,11 +1899,12 @@ void usb_disconnect(struct usb_device **pdev) ...@@ -1899,11 +1899,12 @@ void usb_disconnect(struct usb_device **pdev)
down(&driver->serialize); down(&driver->serialize);
driver->disconnect(dev, interface->private_data); driver->disconnect(dev, interface->private_data);
up(&driver->serialize); up(&driver->serialize);
if (driver->owner)
__MOD_DEC_USE_COUNT(driver->owner);
/* if driver->disconnect didn't release the interface */ /* if driver->disconnect didn't release the interface */
if (interface->driver) if (interface->driver)
usb_driver_release_interface(driver, interface); usb_driver_release_interface(driver, interface);
/* we don't need the driver any longer */
if (driver->owner)
__MOD_DEC_USE_COUNT(driver->owner);
} }
/* remove our device node for this interface */ /* remove our device node for this interface */
put_device(&interface->dev); put_device(&interface->dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment