Commit 27a737ff authored by Johannes Berg's avatar Johannes Berg

mac80211: always synchronize_net() during station removal

If there are keys left during station removal, then a
synchronize_net() will be done (for each key, I have a
patch to address this for 3.10), otherwise it won't be
done at all which causes issues because the station
could be used for TX while it's being removed from the
driver -- that might confuse the driver.

Fix this by always doing synchronize_net() if no key
was present any more.

Signed-off-by: default avatarJohannes Berg <>
parent 801d929c
......@@ -766,6 +766,7 @@ int __must_check __sta_info_destroy(struct sta_info *sta)
struct ieee80211_local *local;
struct ieee80211_sub_if_data *sdata;
int ret, i;
bool have_key = false;
......@@ -793,12 +794,19 @@ int __must_check __sta_info_destroy(struct sta_info *sta)
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;
if (!have_key)
sta->dead = true;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment