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

brcmfmac: on halting driver check before release or free.

brcmf_netdev_stop shall first check bus_if status before bringing
down cfg80211. brcmf_detach shall first check if driver is
allocated.
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 6034d0a1
...@@ -600,10 +600,12 @@ static int brcmf_netdev_stop(struct net_device *ndev) ...@@ -600,10 +600,12 @@ static int brcmf_netdev_stop(struct net_device *ndev)
struct brcmf_pub *drvr = ifp->drvr; struct brcmf_pub *drvr = ifp->drvr;
brcmf_dbg(TRACE, "Enter\n"); brcmf_dbg(TRACE, "Enter\n");
brcmf_cfg80211_down(drvr->config);
if (drvr->bus_if->drvr_up == 0) if (drvr->bus_if->drvr_up == 0)
return 0; return 0;
brcmf_cfg80211_down(drvr->config);
/* Set state and stop OS transmissions */ /* Set state and stop OS transmissions */
drvr->bus_if->drvr_up = false; drvr->bus_if->drvr_up = false;
netif_stop_queue(ndev); netif_stop_queue(ndev);
...@@ -905,6 +907,8 @@ void brcmf_detach(struct device *dev) ...@@ -905,6 +907,8 @@ void brcmf_detach(struct device *dev)
brcmf_dbg(TRACE, "Enter\n"); brcmf_dbg(TRACE, "Enter\n");
if (drvr == NULL)
return;
/* make sure primary interface removed last */ /* make sure primary interface removed last */
for (i = BRCMF_MAX_IFS-1; i > -1; i--) for (i = BRCMF_MAX_IFS-1; i > -1; i--)
......
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