brcmfmac: Check null pointer on brcmf_dev_reset.
authorHante Meuleman <meuleman@broadcom.com>
Fri, 8 Feb 2013 11:06:32 +0000 (12:06 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 8 Feb 2013 19:51:36 +0000 (14:51 -0500)
When unloading it is possible that drvr is not null, but iflist[0]
is. So check iflist[0] pointer before using it.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c

index db03d30f60b7a4af9703ab7d379bb5da33a0957d..f90db576e90bb016bae41a34ce9d666bf869c8ab 100644 (file)
@@ -842,7 +842,8 @@ void brcmf_dev_reset(struct device *dev)
        if (drvr == NULL)
                return;
 
-       brcmf_fil_cmd_int_set(drvr->iflist[0], BRCMF_C_TERMINATED, 1);
+       if (drvr->iflist[0])
+               brcmf_fil_cmd_int_set(drvr->iflist[0], BRCMF_C_TERMINATED, 1);
 }
 
 void brcmf_detach(struct device *dev)