summaryrefslogtreecommitdiffstats
path: root/drivers/usb/wusbcore/wusbhc.c
diff options
context:
space:
mode:
authorThomas Pugliese2013-06-24 21:26:35 +0200
committerGreg Kroah-Hartman2013-06-25 01:20:43 +0200
commita899575191ba85a71401f2c8f36bec7b14487043 (patch)
tree74070049b20ec44cf625db68ac62751e4b33cab0 /drivers/usb/wusbcore/wusbhc.c
parentwusbcore: add entries in Documentation/ABI for new wusbhc sysfs attributes (diff)
downloadkernel-qcow2-linux-a899575191ba85a71401f2c8f36bec7b14487043.tar.gz
kernel-qcow2-linux-a899575191ba85a71401f2c8f36bec7b14487043.tar.xz
kernel-qcow2-linux-a899575191ba85a71401f2c8f36bec7b14487043.zip
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/wusbhc.c')
-rw-r--r--drivers/usb/wusbcore/wusbhc.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/usb/wusbcore/wusbhc.c b/drivers/usb/wusbcore/wusbhc.c
index e712af3e46c2..742c607d1fa3 100644
--- a/drivers/usb/wusbcore/wusbhc.c
+++ b/drivers/usb/wusbcore/wusbhc.c
@@ -325,13 +325,7 @@ int wusbhc_b_create(struct wusbhc *wusbhc)
goto error_create_attr_group;
}
- result = wusbhc_pal_register(wusbhc);
- if (result < 0)
- goto error_pal_register;
return 0;
-
-error_pal_register:
- sysfs_remove_group(wusbhc_kobj(wusbhc), &wusbhc_attr_group);
error_create_attr_group:
return result;
}
@@ -457,7 +451,8 @@ EXPORT_SYMBOL_GPL(wusbhc_giveback_urb);
*/
void wusbhc_reset_all(struct wusbhc *wusbhc)
{
- uwb_rc_reset_all(wusbhc->uwb_rc);
+ if (wusbhc->uwb_rc)
+ uwb_rc_reset_all(wusbhc->uwb_rc);
}
EXPORT_SYMBOL_GPL(wusbhc_reset_all);