diff options
-rw-r--r-- | net/mac80211/work.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/mac80211/work.c b/net/mac80211/work.c index ae344d1ba056..146097cb43a7 100644 --- a/net/mac80211/work.c +++ b/net/mac80211/work.c | |||
@@ -1051,11 +1051,13 @@ void ieee80211_work_purge(struct ieee80211_sub_if_data *sdata) | |||
1051 | { | 1051 | { |
1052 | struct ieee80211_local *local = sdata->local; | 1052 | struct ieee80211_local *local = sdata->local; |
1053 | struct ieee80211_work *wk; | 1053 | struct ieee80211_work *wk; |
1054 | bool cleanup = false; | ||
1054 | 1055 | ||
1055 | mutex_lock(&local->mtx); | 1056 | mutex_lock(&local->mtx); |
1056 | list_for_each_entry(wk, &local->work_list, list) { | 1057 | list_for_each_entry(wk, &local->work_list, list) { |
1057 | if (wk->sdata != sdata) | 1058 | if (wk->sdata != sdata) |
1058 | continue; | 1059 | continue; |
1060 | cleanup = true; | ||
1059 | wk->type = IEEE80211_WORK_ABORT; | 1061 | wk->type = IEEE80211_WORK_ABORT; |
1060 | wk->started = true; | 1062 | wk->started = true; |
1061 | wk->timeout = jiffies; | 1063 | wk->timeout = jiffies; |
@@ -1063,7 +1065,8 @@ void ieee80211_work_purge(struct ieee80211_sub_if_data *sdata) | |||
1063 | mutex_unlock(&local->mtx); | 1065 | mutex_unlock(&local->mtx); |
1064 | 1066 | ||
1065 | /* run cleanups etc. */ | 1067 | /* run cleanups etc. */ |
1066 | ieee80211_work_work(&local->work_work); | 1068 | if (cleanup) |
1069 | ieee80211_work_work(&local->work_work); | ||
1067 | 1070 | ||
1068 | mutex_lock(&local->mtx); | 1071 | mutex_lock(&local->mtx); |
1069 | list_for_each_entry(wk, &local->work_list, list) { | 1072 | list_for_each_entry(wk, &local->work_list, list) { |