Skip to content

Commit

Permalink
brcmfmac: fix brcmf_fws_add_interface() for USB devices
Browse files Browse the repository at this point in the history
USB devices rely on queuing functionality provided by the fwsignal
module regardless the mode fwsignal is operating in. For this some
data structure needs to be reserved which is tied to the interface,
which is done by brcmf_fws_add_interface(). However, it checks the
mode. Replace that by checking result from brcmf_fws_queue_skbs().
Otherwise the driver will crash in a null pointer dereference when
data is transmitted on the interface.

Fixes: fc0471e ("brcmfmac: ignore interfaces when fwsignal is disabled")
Reviewed-by: Franky Lin <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
  • Loading branch information
Arend Van Spriel authored and Kalle Valo committed Jun 15, 2017
1 parent 7a51461 commit a2b7a62
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2145,7 +2145,7 @@ void brcmf_fws_add_interface(struct brcmf_if *ifp)
struct brcmf_fws_info *fws = drvr_to_fws(ifp->drvr);
struct brcmf_fws_mac_descriptor *entry;

if (!ifp->ndev || fws->fcmode == BRCMF_FWS_FCMODE_NONE)
if (!ifp->ndev || !brcmf_fws_queue_skbs(fws))
return;

entry = &fws->desc.iface[ifp->ifidx];
Expand Down

0 comments on commit a2b7a62

Please sign in to comment.