aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/mac80211/ibss.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index d4e84b22a66d..090e344d5f90 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -943,11 +943,6 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
943 } 943 }
944 } 944 }
945 945
946 del_timer_sync(&sdata->u.ibss.timer);
947 clear_bit(IEEE80211_IBSS_REQ_RUN, &sdata->u.ibss.request);
948 cancel_work_sync(&sdata->work);
949 clear_bit(IEEE80211_IBSS_REQ_RUN, &sdata->u.ibss.request);
950
951 sta_info_flush(sdata->local, sdata); 946 sta_info_flush(sdata->local, sdata);
952 947
953 /* remove beacon */ 948 /* remove beacon */
@@ -964,6 +959,20 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
964 memset(sdata->u.ibss.bssid, 0, ETH_ALEN); 959 memset(sdata->u.ibss.bssid, 0, ETH_ALEN);
965 sdata->u.ibss.ssid_len = 0; 960 sdata->u.ibss.ssid_len = 0;
966 961
962 /*
963 * ssid_len indicates active or not, so needs to be visible to
964 * everybody, especially ieee80211_ibss_notify_scan_completed,
965 * so it won't restart the timer after we remove it here.
966 */
967 mb();
968
969 del_timer_sync(&sdata->u.ibss.timer);
970 clear_bit(IEEE80211_IBSS_REQ_RUN, &sdata->u.ibss.request);
971 /*
972 * Since the REQ_RUN bit is clear, the work won't do
973 * anything if it runs after this.
974 */
975
967 ieee80211_recalc_idle(sdata->local); 976 ieee80211_recalc_idle(sdata->local);
968 977
969 return 0; 978 return 0;