mirror of
https://github.com/torvalds/linux.git
synced 2026-11-24 23:47:06 +00:00
During surprise device hotplug removal tests, it was observed that hub_events may try to call usb_lock_device on a device that has already been freed. Protect the usb_device by taking out a reference (under the hub_event_lock) when hub_events pulls it off the list, returning the reference after hub_events is finished using it. Signed-off-by: Joe Lawrence <[email protected]> Suggested-by: David Bulkow <[email protected]> for using kref Suggested-by: Alan Stern <[email protected]> for placement Acked-by: Alan Stern <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>