From: Hante Meuleman Date: Fri, 8 Feb 2013 11:06:32 +0000 (+0100) Subject: brcmfmac: Check null pointer on brcmf_dev_reset. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=643ecaab355c3879215cb34c10ae88d729e408be;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git brcmfmac: Check null pointer on brcmf_dev_reset. 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 Reviewed-by: Pieter-Paul Giesberts Reviewed-by: Piotr Haber Signed-off-by: Hante Meuleman Signed-off-by: Arend van Spriel Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c index db03d30f60b7..f90db576e90b 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c @@ -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)