mac80211: fix IBSS code to not sleep while atomic
authorJohannes Berg <johannes@sipsolutions.net>
Mon, 20 Apr 2009 22:30:49 +0000 (00:30 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 22 Apr 2009 20:57:19 +0000 (16:57 -0400)
With the RCU locking here we sleep while in an atomic context,
since we can sleep just use mutex locking for the interface
list instead of RCU. Sorry, seems I didn't get that in my UML
test.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/ibss.c

index 4f7a54518be41508074496aeb555bdf963f932a5..6030e003180cca92f1dcbf70e7af5217eb4405e7 100644 (file)
@@ -784,14 +784,14 @@ void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local)
 {
        struct ieee80211_sub_if_data *sdata;
 
-       rcu_read_lock();
-       list_for_each_entry_rcu(sdata, &local->interfaces, list) {
+       mutex_lock(&local->iflist_mtx);
+       list_for_each_entry(sdata, &local->interfaces, list) {
                if (sdata->vif.type != NL80211_IFTYPE_ADHOC)
                        continue;
                sdata->u.ibss.last_scan_completed = jiffies;
                ieee80211_sta_find_ibss(sdata);
        }
-       rcu_read_unlock();
+       mutex_unlock(&local->iflist_mtx);
 }
 
 ieee80211_rx_result