summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2023-08-29 11:25:50 +0200
committerJohannes Berg <johannes.berg@intel.com>2023-09-11 11:27:23 +0200
commitb7600aae8a20ff267ae82ff3c51cef536cd6383d (patch)
treed32e74b02e3fa2af3d8f6d32f4e2980e78521747 /net
parent2ae5c9248e06dac2c2360be26b4e25f673238337 (diff)
downloadlinux-stable-b7600aae8a20ff267ae82ff3c51cef536cd6383d.tar.gz
linux-stable-b7600aae8a20ff267ae82ff3c51cef536cd6383d.tar.bz2
linux-stable-b7600aae8a20ff267ae82ff3c51cef536cd6383d.zip
wifi: mac80211: fix TXQ error path and cleanup
We currently call ieee80211_txq_teardown_flows() as part of ieee80211_remove_interfaces(), but that's not really right in case of HW registration failures, specifically rate control. Call it separately to fix that issue. Reported-by: Zhengchao Shao <shaozhengchao@huawei.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/iface.c2
-rw-r--r--net/mac80211/main.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 7e3acf670f0f..510f8aead4f9 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -2255,8 +2255,6 @@ void ieee80211_remove_interfaces(struct ieee80211_local *local)
WARN(local->open_count, "%s: open count remains %d\n",
wiphy_name(local->hw.wiphy), local->open_count);
- ieee80211_txq_teardown_flows(local);
-
mutex_lock(&local->iflist_mtx);
list_splice_init(&local->interfaces, &unreg_list);
mutex_unlock(&local->iflist_mtx);
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 0ab603850a85..eabf6c1bf3ff 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -1457,6 +1457,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
ieee80211_remove_interfaces(local);
rtnl_unlock();
fail_rate:
+ ieee80211_txq_teardown_flows(local);
fail_flows:
ieee80211_led_exit(local);
destroy_workqueue(local->workqueue);
@@ -1493,6 +1494,8 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw)
*/
ieee80211_remove_interfaces(local);
+ ieee80211_txq_teardown_flows(local);
+
wiphy_lock(local->hw.wiphy);
wiphy_delayed_work_cancel(local->hw.wiphy, &local->roc_work);
wiphy_work_cancel(local->hw.wiphy, &local->reconfig_filter);