summaryrefslogtreecommitdiff
path: root/drivers/usb/wusbcore/pal.c
diff options
context:
space:
mode:
authorThomas Pugliese <thomas.pugliese@gmail.com>2013-06-24 14:26:35 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-06-24 16:20:43 -0700
commita899575191ba85a71401f2c8f36bec7b14487043 (patch)
tree74070049b20ec44cf625db68ac62751e4b33cab0 /drivers/usb/wusbcore/pal.c
parent6e6581e0a94758a4e69fab82407d39312eeff5c4 (diff)
USB: HWA: fix device probe failure
This patch fixes a race condition that caused the HWA_HC interface probe function to occasionally fail. The HWA_HC would attempt to register itself with the HWA_RC by searching for a uwb_rc class device with the same parent device ptr. If the probe function for the HWA_RC interface had yet to run, the uwb_rc class device would not have been created causing the look up to fail and the HWA_HC probe function to return an error causing the device to be unusable. The fix is for the HWA to delay registering with the HWA_RC until receiving the command from userspace to start the wireless channel. It is the responsibility of userspace to ensure that the uwb_rc class device has been created before starting the HWA channel. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/wusbcore/pal.c')
-rw-r--r--drivers/usb/wusbcore/pal.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/wusbcore/pal.c b/drivers/usb/wusbcore/pal.c
index d0b172c5ecc7..59e100c2eb50 100644
--- a/drivers/usb/wusbcore/pal.c
+++ b/drivers/usb/wusbcore/pal.c
@@ -45,10 +45,11 @@ int wusbhc_pal_register(struct wusbhc *wusbhc)
}
/**
- * wusbhc_pal_register - unregister the WUSB HC as a UWB PAL
+ * wusbhc_pal_unregister - unregister the WUSB HC as a UWB PAL
* @wusbhc: the WUSB HC
*/
void wusbhc_pal_unregister(struct wusbhc *wusbhc)
{
- uwb_pal_unregister(&wusbhc->pal);
+ if (wusbhc->uwb_rc)
+ uwb_pal_unregister(&wusbhc->pal);
}