From 881571899255438afc9bec4451babdad84f0da3a Mon Sep 17 00:00:00 2001 From: nbd Date: Fri, 15 Mar 2013 22:29:27 +0000 Subject: mac80211: merge a fix for a race condition on station removal git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36053 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/mac80211/patches/300-pending_work.patch | 32 +++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'package/mac80211') diff --git a/package/mac80211/patches/300-pending_work.patch b/package/mac80211/patches/300-pending_work.patch index 3d4e85ddd..72a0081c1 100644 --- a/package/mac80211/patches/300-pending_work.patch +++ b/package/mac80211/patches/300-pending_work.patch @@ -896,3 +896,35 @@ if (needreset) { ath_dbg(ath9k_hw_common(sc->sc_ah), RESET, +--- a/net/mac80211/sta_info.c ++++ b/net/mac80211/sta_info.c +@@ -766,6 +766,7 @@ int __must_check __sta_info_destroy(stru + struct ieee80211_local *local; + struct ieee80211_sub_if_data *sdata; + int ret, i; ++ bool have_key = false; + + might_sleep(); + +@@ -793,12 +794,19 @@ int __must_check __sta_info_destroy(stru + list_del_rcu(&sta->list); + + mutex_lock(&local->key_mtx); +- for (i = 0; i < NUM_DEFAULT_KEYS; i++) ++ for (i = 0; i < NUM_DEFAULT_KEYS; i++) { + __ieee80211_key_free(key_mtx_dereference(local, sta->gtk[i])); +- if (sta->ptk) ++ have_key = true; ++ } ++ if (sta->ptk) { + __ieee80211_key_free(key_mtx_dereference(local, sta->ptk)); ++ have_key = true; ++ } + mutex_unlock(&local->key_mtx); + ++ if (!have_key) ++ synchronize_net(); ++ + sta->dead = true; + + local->num_sta--; -- cgit v1.2.3