diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2016-02-03 23:36:33 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-06 21:55:57 -0800 |
commit | b1249ab513017efdff646b26b46b5399bd91773b (patch) | |
tree | 66de0133f96df98e612d2778fbd6f5e86169dd40 /drivers/usb/host/r8a66597-hcd.c | |
parent | a4b5d606b957c6a58e991de63fe999492de1ab92 (diff) |
usb: r8a66597: add locking to r8a66597_check_detect_child
Use mutex usb_bus_idr_lock to protect idr_find.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/r8a66597-hcd.c')
-rw-r--r-- | drivers/usb/host/r8a66597-hcd.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c index 1ef887361ac0..bfa7fa3d2eea 100644 --- a/drivers/usb/host/r8a66597-hcd.c +++ b/drivers/usb/host/r8a66597-hcd.c @@ -2099,11 +2099,13 @@ static void r8a66597_check_detect_child(struct r8a66597 *r8a66597, memset(now_map, 0, sizeof(now_map)); + mutex_lock(&usb_bus_idr_lock); bus = idr_find(&usb_bus_idr, hcd->self.busnum); if (bus && bus->root_hub) { collect_usb_address_map(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) |