summaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2013-06-19 14:06:25 -0700
committerJohannes Berg <johannes.berg@intel.com>2013-06-24 15:51:22 +0200
commit6f390908e58113b9199424749c32a05181ff69d9 (patch)
treeff97b48c33d3fcc289a7e853e2f7cb0258f75b3a /net/wireless
parentf1940c5730f0f0555e42afbcf629be7f7fbbce8e (diff)
downloadlinux-stable-6f390908e58113b9199424749c32a05181ff69d9.tar.gz
linux-stable-6f390908e58113b9199424749c32a05181ff69d9.tar.bz2
linux-stable-6f390908e58113b9199424749c32a05181ff69d9.zip
wireless: Make sure __cfg80211_connect_result always puts bss
Otherwise, we can leak a bss reference. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/sme.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index c0bf781d4fbe..32dac8cdd2e3 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -557,6 +557,7 @@ static DECLARE_WORK(cfg80211_disconnect_work, disconnect_work);
* SME event handling
*/
+/* This method must consume bss one way or another */
void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
const u8 *req_ie, size_t req_ie_len,
const u8 *resp_ie, size_t resp_ie_len,
@@ -572,8 +573,10 @@ void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
ASSERT_WDEV_LOCK(wdev);
if (WARN_ON(wdev->iftype != NL80211_IFTYPE_STATION &&
- wdev->iftype != NL80211_IFTYPE_P2P_CLIENT))
+ wdev->iftype != NL80211_IFTYPE_P2P_CLIENT)) {
+ cfg80211_put_bss(wdev->wiphy, bss);
return;
+ }
nl80211_send_connect_result(wiphy_to_dev(wdev->wiphy), dev,
bssid, req_ie, req_ie_len,