From a899575191ba85a71401f2c8f36bec7b14487043 Mon Sep 17 00:00:00 2001 From: Thomas Pugliese Date: Mon, 24 Jun 2013 14:26:35 -0500 Subject: 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 Signed-off-by: Greg Kroah-Hartman --- drivers/usb/wusbcore/reservation.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/usb/wusbcore/reservation.c') diff --git a/drivers/usb/wusbcore/reservation.c b/drivers/usb/wusbcore/reservation.c index 6f4fafd..ead79f7 100644 --- a/drivers/usb/wusbcore/reservation.c +++ b/drivers/usb/wusbcore/reservation.c @@ -80,6 +80,9 @@ int wusbhc_rsv_establish(struct wusbhc *wusbhc) struct uwb_dev_addr bcid; int ret; + if (rc == NULL) + return -ENODEV; + rsv = uwb_rsv_create(rc, wusbhc_rsv_complete_cb, wusbhc); if (rsv == NULL) return -ENOMEM; -- cgit v1.1