diff options
author | Arend van Spriel <arend@broadcom.com> | 2015-06-15 22:48:39 +0200 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-06-16 10:35:10 +0200 |
commit | 40b503c76481aecf811a29a14a80c13b429b5e14 (patch) | |
tree | aa23af53a8c1dcd143de0bd5a6c36398ac529788 /drivers/net/wireless | |
parent | brcmfmac: fix double free of p2pdev interface (diff) | |
download | linux-40b503c76481aecf811a29a14a80c13b429b5e14.tar.xz linux-40b503c76481aecf811a29a14a80c13b429b5e14.zip |
brcmfmac: make brcmf_p2p_detach() call conditional
During verification of error handling in brcmf_cfg80211_attach() a
null pointer dereference occurred upon calling brcmf_p2p_detach()
from brcmf_detach(). This should only be called when the
brcmf_cfg80211_attach() has succeeded.
Fixes: f7a40873d2fa ("brcmfmac: assure p2pdev is unregistered upon driver unload")
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/core.c b/drivers/net/wireless/brcm80211/brcmfmac/core.c index 866b818889e6..fe9d3fbf5fe2 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/core.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c @@ -1098,7 +1098,8 @@ void brcmf_detach(struct device *dev) /* stop firmware event handling */ brcmf_fweh_detach(drvr); - brcmf_p2p_detach(&drvr->config->p2p); + if (drvr->config) + brcmf_p2p_detach(&drvr->config->p2p); brcmf_bus_change_state(bus_if, BRCMF_BUS_DOWN); |