diff options
author | Franky Lin <frankyl@broadcom.com> | 2011-11-10 14:30:34 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-11-11 14:28:47 -0500 |
commit | e78946e198b9cf2656dceb5ea2c21759f469a125 (patch) | |
tree | 5b5cbeb6e8feb3fc6ec75e6a44519374e33d56fe /drivers/net/wireless | |
parent | 99b72cde632b67603f4c7f18e8ff23a57b484478 (diff) |
brcm80211: fmac: release bss struct returned from cfg80211_inform_bss
Referenced struct returned by cfg80211_inform_bss must be released with
cfg80211_put_bss to avoid memory leak.
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@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')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c index 73be2c8d4cee..cc19a733ac65 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | |||
@@ -2049,10 +2049,10 @@ static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_priv *cfg_priv, | |||
2049 | notify_timestamp, notify_capability, notify_interval, notify_ie, | 2049 | notify_timestamp, notify_capability, notify_interval, notify_ie, |
2050 | notify_ielen, notify_signal, GFP_KERNEL); | 2050 | notify_ielen, notify_signal, GFP_KERNEL); |
2051 | 2051 | ||
2052 | if (!bss) { | 2052 | if (!bss) |
2053 | WL_ERR("cfg80211_inform_bss_frame error\n"); | 2053 | return -ENOMEM; |
2054 | return -EINVAL; | 2054 | |
2055 | } | 2055 | cfg80211_put_bss(bss); |
2056 | 2056 | ||
2057 | return err; | 2057 | return err; |
2058 | } | 2058 | } |
@@ -2096,6 +2096,7 @@ static s32 wl_inform_ibss(struct brcmf_cfg80211_priv *cfg_priv, | |||
2096 | struct ieee80211_channel *notify_channel; | 2096 | struct ieee80211_channel *notify_channel; |
2097 | struct brcmf_bss_info_le *bi = NULL; | 2097 | struct brcmf_bss_info_le *bi = NULL; |
2098 | struct ieee80211_supported_band *band; | 2098 | struct ieee80211_supported_band *band; |
2099 | struct cfg80211_bss *bss; | ||
2099 | u8 *buf = NULL; | 2100 | u8 *buf = NULL; |
2100 | s32 err = 0; | 2101 | s32 err = 0; |
2101 | u16 channel; | 2102 | u16 channel; |
@@ -2149,10 +2150,17 @@ static s32 wl_inform_ibss(struct brcmf_cfg80211_priv *cfg_priv, | |||
2149 | WL_CONN("signal: %d\n", notify_signal); | 2150 | WL_CONN("signal: %d\n", notify_signal); |
2150 | WL_CONN("notify_timestamp: %#018llx\n", notify_timestamp); | 2151 | WL_CONN("notify_timestamp: %#018llx\n", notify_timestamp); |
2151 | 2152 | ||
2152 | cfg80211_inform_bss(wiphy, notify_channel, bssid, | 2153 | bss = cfg80211_inform_bss(wiphy, notify_channel, bssid, |
2153 | notify_timestamp, notify_capability, notify_interval, | 2154 | notify_timestamp, notify_capability, notify_interval, |
2154 | notify_ie, notify_ielen, notify_signal, GFP_KERNEL); | 2155 | notify_ie, notify_ielen, notify_signal, GFP_KERNEL); |
2155 | 2156 | ||
2157 | if (!bss) { | ||
2158 | err = -ENOMEM; | ||
2159 | goto CleanUp; | ||
2160 | } | ||
2161 | |||
2162 | cfg80211_put_bss(bss); | ||
2163 | |||
2156 | CleanUp: | 2164 | CleanUp: |
2157 | 2165 | ||
2158 | kfree(buf); | 2166 | kfree(buf); |