Skip to content

Commit

Permalink
usb: wusbcore: fix panic in wusbhc_chid_set
Browse files Browse the repository at this point in the history
If no valid CHID value has previously been set on an HWA, writing a
value of all zeros will cause a kernel panic in uwb_radio_stop because
wusbhc->uwb_rc has not been set.  This patch skips the call to
uwb_radio_stop if wusbhc->uwb_rc has not been initialized.

Signed-off-by: Thomas Pugliese <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
TomServo3000 authored and gregkh committed Apr 24, 2014
1 parent 7584f2e commit bd130ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/wusbcore/mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ int wusbhc_chid_set(struct wusbhc *wusbhc, const struct wusb_ckhdid *chid)

if (chid)
result = uwb_radio_start(&wusbhc->pal);
else
else if (wusbhc->uwb_rc)
uwb_radio_stop(&wusbhc->pal);

return result;
Expand Down

0 comments on commit bd130ad

Please sign in to comment.