Commit b1249ab5 authored by Heiner Kallweit's avatar Heiner Kallweit Committed by Greg Kroah-Hartman

usb: r8a66597: add locking to r8a66597_check_detect_child

Use mutex usb_bus_idr_lock to protect idr_find.
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a4b5d606
...@@ -2099,11 +2099,13 @@ static void r8a66597_check_detect_child(struct r8a66597 *r8a66597, ...@@ -2099,11 +2099,13 @@ static void r8a66597_check_detect_child(struct r8a66597 *r8a66597,
memset(now_map, 0, sizeof(now_map)); memset(now_map, 0, sizeof(now_map));
mutex_lock(&usb_bus_idr_lock);
bus = idr_find(&usb_bus_idr, hcd->self.busnum); bus = idr_find(&usb_bus_idr, hcd->self.busnum);
if (bus && bus->root_hub) { if (bus && bus->root_hub) {
collect_usb_address_map(bus->root_hub, now_map); collect_usb_address_map(bus->root_hub, now_map);
update_usb_address_map(r8a66597, bus->root_hub, now_map); update_usb_address_map(r8a66597, bus->root_hub, now_map);
} }
mutex_unlock(&usb_bus_idr_lock);
} }
static int r8a66597_hub_status_data(struct usb_hcd *hcd, char *buf) static int r8a66597_hub_status_data(struct usb_hcd *hcd, char *buf)
......
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