summaryrefslogtreecommitdiffstats
path: root/net/mac80211/main.c
diff options
context:
space:
mode:
authorJohannes Berg2009-01-23 22:54:03 +0100
committerJohn W. Linville2009-01-29 22:01:45 +0100
commitc771c9d8da1e8292ef8bf7fd4ce135dacc650130 (patch)
tree79b259a6b0396cbecf9e775c7ba5a80e2c4d94c9 /net/mac80211/main.c
parentairo: remove useless #defines (diff)
downloadkernel-qcow2-linux-c771c9d8da1e8292ef8bf7fd4ce135dacc650130.tar.gz
kernel-qcow2-linux-c771c9d8da1e8292ef8bf7fd4ce135dacc650130.tar.xz
kernel-qcow2-linux-c771c9d8da1e8292ef8bf7fd4ce135dacc650130.zip
mac80211: add interface list lock
Using only the RTNL has a number of problems, most notably that ieee80211_iterate_active_interfaces() and other interface list traversals cannot be done from the internal workqueue because it needs to be flushed under the RTNL. This patch introduces a new mutex that protects the interface list against modifications. A more detailed explanation is part of the code change. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r--net/mac80211/main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 210dfe3cf6c3..a109c06e8e4e 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -758,6 +758,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
local->hw.conf.radio_enabled = true;
INIT_LIST_HEAD(&local->interfaces);
+ mutex_init(&local->iflist_mtx);
spin_lock_init(&local->key_lock);
@@ -1008,6 +1009,8 @@ void ieee80211_free_hw(struct ieee80211_hw *hw)
{
struct ieee80211_local *local = hw_to_local(hw);
+ mutex_destroy(&local->iflist_mtx);
+
wiphy_free(local->hw.wiphy);
}
EXPORT_SYMBOL(ieee80211_free_hw);