summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
diff options
context:
space:
mode:
authorArend van Spriel <arend@broadcom.com>2015-08-26 22:15:04 +0200
committerKalle Valo <kvalo@codeaurora.org>2015-09-29 09:28:52 +0200
commit95ef12394a4d002c7ed3bcbed224f3391792a02b (patch)
tree9a6d1b39b10586c7272d2a2c7020d2aa359447f3 /drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
parentbrcmfmac: change prototype for brcmf_fws_hdrpull() (diff)
downloadlinux-95ef12394a4d002c7ed3bcbed224f3391792a02b.tar.xz
linux-95ef12394a4d002c7ed3bcbed224f3391792a02b.zip
brcmfmac: introduce brcmf_net_detach() function
In case of error during brcmf_bus_start() the network interfaces were freed using free_netdev(). However, the interfaces may have additional memory allocated which is not freed. The netdev has destructor set to brcmf_cfg80211_free_netdev() which frees the additional memory if allocated and call free_netdev(). The brcmf_net_detach() either calls brcmf_cfg80211_free_netdev() directly or uses unregister_netdev() when struct net_device::reg_state indicates the netdev was registered. Reported-by: Daniel (Deognyoun) Kim <dekim@broadcom.com> 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/brcm80211/brcmfmac/cfg80211.c')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
index cee9ff46626e..600098dd197c 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
@@ -4747,7 +4747,8 @@ void brcmf_cfg80211_free_netdev(struct net_device *ndev)
ifp = netdev_priv(ndev);
vif = ifp->vif;
- brcmf_free_vif(vif);
+ if (vif)
+ brcmf_free_vif(vif);
free_netdev(ndev);
}