Commit df19e777 authored by Hante Meuleman's avatar Hante Meuleman Committed by John W. Linville

brcmfmac: fix NULL pointer access in brcmf_fweh_detach()

brcmf_fweh_detach can be called while ifp is already NULL, due to
init error. Fix NULL pointer access by checking ifp.
Reviewed-by: default avatarArend Van Spriel <arend@broadcom.com>
Signed-off-by: default avatarHante Meuleman <meuleman@broadcom.com>
Signed-off-by: default avatarFranky Lin <frankyl@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 0b63cb71
...@@ -374,11 +374,13 @@ void brcmf_fweh_detach(struct brcmf_pub *drvr) ...@@ -374,11 +374,13 @@ void brcmf_fweh_detach(struct brcmf_pub *drvr)
struct brcmf_if *ifp = drvr->iflist[0]; struct brcmf_if *ifp = drvr->iflist[0];
s8 eventmask[BRCMF_EVENTING_MASK_LEN]; s8 eventmask[BRCMF_EVENTING_MASK_LEN];
if (ifp) {
/* clear all events */ /* clear all events */
memset(eventmask, 0, BRCMF_EVENTING_MASK_LEN); memset(eventmask, 0, BRCMF_EVENTING_MASK_LEN);
(void)brcmf_fil_iovar_data_set(ifp, "event_msgs", (void)brcmf_fil_iovar_data_set(ifp, "event_msgs",
eventmask, BRCMF_EVENTING_MASK_LEN); eventmask,
BRCMF_EVENTING_MASK_LEN);
}
/* cancel the worker */ /* cancel the worker */
cancel_work_sync(&fweh->event_work); cancel_work_sync(&fweh->event_work);
WARN_ON(!list_empty(&fweh->event_q)); WARN_ON(!list_empty(&fweh->event_q));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment