Commit d23021de authored by Duncan Sands's avatar Duncan Sands Committed by Greg Kroah-Hartman

[PATCH] USB: fix deadlock in hub_reset

usb_reset_device takes hdev->serialize.  However, hub_reset is
(only) called by hub_events, which already holds the lock.  Thanks
to Tyler Nielsen for the bug report and helpful backtrace.
Signed-off-by: default avatarDuncan Sands <baldrick@free.fr>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent a562c020
......@@ -794,7 +794,7 @@ hub_ioctl(struct usb_interface *intf, unsigned int code, void *user_data)
}
}
/* caller has locked the hub */
/* caller has locked the hub and must own the device lock */
static int hub_reset(struct usb_hub *hub)
{
struct usb_device *hdev = hub->hdev;
......@@ -812,7 +812,7 @@ static int hub_reset(struct usb_hub *hub)
else
return -1;
if (usb_reset_device(hdev))
if (__usb_reset_device(hdev))
return -1;
hub->urb->dev = hdev;
......
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