From dc6676b7f2c2072ec05254aaca32e99f87a8a417 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Mon, 31 Mar 2008 19:23:03 +0200 Subject: mac80211: sta_info_flush() fixes When the IBSS code tries to flush the STA list, it does so in an atomic context. Flushing isn't safe there, however, and requires the RTNL, so we need to defer it to a workqueue. Signed-off-by: Johannes Berg Signed-off-by: John W. Linville --- net/mac80211/key.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'net/mac80211/key.c') diff --git a/net/mac80211/key.c b/net/mac80211/key.c index f91fb409265..5df9e0cc009 100644 --- a/net/mac80211/key.c +++ b/net/mac80211/key.c @@ -73,6 +73,15 @@ static void ieee80211_key_enable_hw_accel(struct ieee80211_key *key) if (!key->local->ops->set_key) return; + /* + * This makes sure that all pending flushes have + * actually completed prior to uploading new key + * material to the hardware. That is necessary to + * avoid races between flushing STAs and adding + * new keys for them. + */ + __ieee80211_run_pending_flush(key->local); + addr = get_mac_for_key(key); ret = key->local->ops->set_key(local_to_hw(key->local), SET_KEY, -- cgit v1.2.3-70-g09d2