aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/work.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/work.c')
-rw-r--r--net/mac80211/work.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/mac80211/work.c b/net/mac80211/work.c
index de43753076d2..36305e0d06ef 100644
--- a/net/mac80211/work.c
+++ b/net/mac80211/work.c
@@ -1074,11 +1074,13 @@ void ieee80211_work_purge(struct ieee80211_sub_if_data *sdata)
1074{ 1074{
1075 struct ieee80211_local *local = sdata->local; 1075 struct ieee80211_local *local = sdata->local;
1076 struct ieee80211_work *wk; 1076 struct ieee80211_work *wk;
1077 bool cleanup = false;
1077 1078
1078 mutex_lock(&local->mtx); 1079 mutex_lock(&local->mtx);
1079 list_for_each_entry(wk, &local->work_list, list) { 1080 list_for_each_entry(wk, &local->work_list, list) {
1080 if (wk->sdata != sdata) 1081 if (wk->sdata != sdata)
1081 continue; 1082 continue;
1083 cleanup = true;
1082 wk->type = IEEE80211_WORK_ABORT; 1084 wk->type = IEEE80211_WORK_ABORT;
1083 wk->started = true; 1085 wk->started = true;
1084 wk->timeout = jiffies; 1086 wk->timeout = jiffies;
@@ -1086,7 +1088,8 @@ void ieee80211_work_purge(struct ieee80211_sub_if_data *sdata)
1086 mutex_unlock(&local->mtx); 1088 mutex_unlock(&local->mtx);
1087 1089
1088 /* run cleanups etc. */ 1090 /* run cleanups etc. */
1089 ieee80211_work_work(&local->work_work); 1091 if (cleanup)
1092 ieee80211_work_work(&local->work_work);
1090 1093
1091 mutex_lock(&local->mtx); 1094 mutex_lock(&local->mtx);
1092 list_for_each_entry(wk, &local->work_list, list) { 1095 list_for_each_entry(wk, &local->work_list, list) {