mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-03 17:14:14 +08:00
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: Arend Van Spriel <arend@broadcom.com> Signed-off-by: Hante Meuleman <meuleman@broadcom.com> Signed-off-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
6034d0a191
commit
817b178c83
@ -600,10 +600,12 @@ static int brcmf_netdev_stop(struct net_device *ndev)
|
||||
struct brcmf_pub *drvr = ifp->drvr;
|
||||
|
||||
brcmf_dbg(TRACE, "Enter\n");
|
||||
brcmf_cfg80211_down(drvr->config);
|
||||
|
||||
if (drvr->bus_if->drvr_up == 0)
|
||||
return 0;
|
||||
|
||||
brcmf_cfg80211_down(drvr->config);
|
||||
|
||||
/* Set state and stop OS transmissions */
|
||||
drvr->bus_if->drvr_up = false;
|
||||
netif_stop_queue(ndev);
|
||||
@ -905,6 +907,8 @@ void brcmf_detach(struct device *dev)
|
||||
|
||||
brcmf_dbg(TRACE, "Enter\n");
|
||||
|
||||
if (drvr == NULL)
|
||||
return;
|
||||
|
||||
/* make sure primary interface removed last */
|
||||
for (i = BRCMF_MAX_IFS-1; i > -1; i--)
|
||||
|
Loading…
Reference in New Issue
Block a user