diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-06-20 14:11:33 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-06-20 14:12:12 -0400 |
commit | 0f6b3f597daab2254614e2773e322e73fb1b6f4b (patch) | |
tree | 88a4d19016a1564598e9e083444d1948dae5c99d /net/mac80211/offchannel.c | |
parent | 3bfda62c50b0a4b118dcfce36686508ca2892292 (diff) |
mac80211: fix double-start of remain-on-channel
When a remain-on-channel item is deleted, we remove it
from the list and then start the next item. However,
if it wasn't actually the first item then calling
ieee80211_start_next_roc() is wrong as it will start
the first item -- even if that was already started.
Fix the two places that do this and add a warning to
prevent the problem from reoccurring.
Reported-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/offchannel.c')
-rw-r--r-- | net/mac80211/offchannel.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c index febce7fb7bb1..7f93626ddc61 100644 --- a/net/mac80211/offchannel.c +++ b/net/mac80211/offchannel.c | |||
@@ -262,6 +262,9 @@ void ieee80211_start_next_roc(struct ieee80211_local *local) | |||
262 | roc = list_first_entry(&local->roc_list, struct ieee80211_roc_work, | 262 | roc = list_first_entry(&local->roc_list, struct ieee80211_roc_work, |
263 | list); | 263 | list); |
264 | 264 | ||
265 | if (WARN_ON_ONCE(roc->started)) | ||
266 | return; | ||
267 | |||
265 | if (local->ops->remain_on_channel) { | 268 | if (local->ops->remain_on_channel) { |
266 | int ret, duration = roc->duration; | 269 | int ret, duration = roc->duration; |
267 | 270 | ||
@@ -377,7 +380,8 @@ void ieee80211_sw_roc_work(struct work_struct *work) | |||
377 | 380 | ||
378 | ieee80211_recalc_idle(local); | 381 | ieee80211_recalc_idle(local); |
379 | 382 | ||
380 | ieee80211_start_next_roc(local); | 383 | if (roc->started) |
384 | ieee80211_start_next_roc(local); | ||
381 | } | 385 | } |
382 | 386 | ||
383 | out_unlock: | 387 | out_unlock: |