diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c index 4b40b461ca78..c46cb81fab22 100644 --- a/net/mac80211/offchannel.c +++ b/net/mac80211/offchannel.c @@ -1075,10 +1075,14 @@ void ieee80211_roc_purge(struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata) { struct ieee80211_roc_work *roc, *tmp; + bool start_next_roc = false; bool work_to_do = false; lockdep_assert_wiphy(local->hw.wiphy); + if (local->ops->remain_on_channel) + wiphy_work_flush(local->hw.wiphy, &local->hw_roc_start); + list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { if (sdata && roc->sdata != sdata) continue; @@ -1088,6 +1092,7 @@ void ieee80211_roc_purge(struct ieee80211_local *local, /* can race, so ignore return value */ drv_cancel_remain_on_channel(local, roc->sdata); ieee80211_roc_notify_destroy(roc); + start_next_roc = true; } else { roc->abort = true; work_to_do = true; @@ -1098,4 +1103,9 @@ void ieee80211_roc_purge(struct ieee80211_local *local, } if (work_to_do) __ieee80211_roc_work(local); + else if (start_next_roc) { + wiphy_work_cancel(local->hw.wiphy, &local->hw_roc_done); + if (!list_empty(&local->roc_list)) + ieee80211_start_next_roc(local); + } }