aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ibss.c
diff options
context:
space:
mode:
authorSimon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>2012-11-13 12:43:03 -0500
committerJohannes Berg <johannes.berg@intel.com>2012-11-13 15:35:07 -0500
commitb78a4932f5fb11fadf41e69c606a33fa6787574c (patch)
tree418a3e8d760ccee586210034b1f111e6c3b43d0d /net/mac80211/ibss.c
parent43c771a1963ab461a2f194e3c97fded1d5fe262f (diff)
mac80211: deinitialize ibss-internals after emptiness check
The check whether the IBSS is active and can be removed should be performed before deinitializing the fields used for the check/search. Otherwise, the configured BSS will not be found and removed properly. To make it more clear for the future, rename sdata->u.ibss to the local pointer ifibss which is used within the checks. This behaviour was introduced by f3209bea110cade12e2b133da8b8499689cb0e2e ("mac80211: fix IBSS teardown race") Cc: stable@vger.kernel.org Cc: Ignacy Gawedzki <i@lri.fr> Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/ibss.c')
-rw-r--r--net/mac80211/ibss.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index bf87c70ac6c5..c21e33d1abd0 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -1151,10 +1151,6 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
1151 1151
1152 mutex_lock(&sdata->u.ibss.mtx); 1152 mutex_lock(&sdata->u.ibss.mtx);
1153 1153
1154 sdata->u.ibss.state = IEEE80211_IBSS_MLME_SEARCH;
1155 memset(sdata->u.ibss.bssid, 0, ETH_ALEN);
1156 sdata->u.ibss.ssid_len = 0;
1157
1158 active_ibss = ieee80211_sta_active_ibss(sdata); 1154 active_ibss = ieee80211_sta_active_ibss(sdata);
1159 1155
1160 if (!active_ibss && !is_zero_ether_addr(ifibss->bssid)) { 1156 if (!active_ibss && !is_zero_ether_addr(ifibss->bssid)) {
@@ -1175,6 +1171,10 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
1175 } 1171 }
1176 } 1172 }
1177 1173
1174 ifibss->state = IEEE80211_IBSS_MLME_SEARCH;
1175 memset(ifibss->bssid, 0, ETH_ALEN);
1176 ifibss->ssid_len = 0;
1177
1178 sta_info_flush(sdata->local, sdata); 1178 sta_info_flush(sdata->local, sdata);
1179 1179
1180 spin_lock_bh(&ifibss->incomplete_lock); 1180 spin_lock_bh(&ifibss->incomplete_lock);