aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless/brcm80211
diff options
context:
space:
mode:
authorArend van Spriel2014-01-06 12:40:48 +0100
committerJohn W. Linville2014-01-06 15:48:05 -0500
commite14799514da335159879bb8c37d5c4491357b0b4 (patch)
treedbba3eded94860ed9b6c1faa0a300e0537ab94b6 /drivers/net/wireless/brcm80211
parent427dec5fc84d6d99f433a6eb008e97aea1757cfb (diff)
brcmfmac: call brcmf_cfg80211_detach() after removal of interfaces
Instead of calling brcmf_cfg80211_detach() in brcmf_del_if() when deleting the primary interface, call it in brcmf_detach() after deleting all interfaces. Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/brcm80211')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c7
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c3
2 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
index bce0b8e511fd..d3c4fba065ad 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
@@ -859,8 +859,6 @@ void brcmf_del_if(struct brcmf_pub *drvr, s32 bssidx)
}
/* unregister will take care of freeing it */
unregister_netdev(ifp->ndev);
- if (bssidx == 0)
- brcmf_cfg80211_detach(drvr->config);
} else {
kfree(ifp);
}
@@ -963,8 +961,7 @@ int brcmf_bus_start(struct device *dev)
fail:
if (ret < 0) {
brcmf_err("failed: %d\n", ret);
- if (drvr->config)
- brcmf_cfg80211_detach(drvr->config);
+ brcmf_cfg80211_detach(drvr->config);
if (drvr->fws) {
brcmf_fws_del_interface(ifp);
brcmf_fws_deinit(drvr);
@@ -1039,6 +1036,8 @@ void brcmf_detach(struct device *dev)
brcmf_del_if(drvr, i);
}
+ brcmf_cfg80211_detach(drvr->config);
+
brcmf_bus_detach(drvr);
brcmf_proto_detach(drvr);
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index 5598a20891d2..3e3de34422bd 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -4975,6 +4975,9 @@ cfg80211_attach_out:
void brcmf_cfg80211_detach(struct brcmf_cfg80211_info *cfg)
{
+ if (!cfg)
+ return;
+
WARN_ON(!list_empty(&cfg->vif_list));
wiphy_unregister(cfg->wiphy);
brcmf_btcoex_detach(cfg);