diff mbox series

wifi: mac80211: remove unnecessary synchronize_net()

Message ID 20221102094746.a4247dff6312.Idef07809e46e74dfd5e82e2951ee16b5a8978db1@changeid
State New
Headers show
Series wifi: mac80211: remove unnecessary synchronize_net() | expand

Commit Message

Johannes Berg Nov. 2, 2022, 8:47 a.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

The call to ieee80211_do_stop() right after will also do
synchronize_rcu() to ensure the SDATA_STATE_RUNNING bit
is cleared, so we don't need to synchronize_net() here.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/iface.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index dd9ac1f7d2ea..02b71b4e094b 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -1898,8 +1898,7 @@  static int ieee80211_runtime_change_iftype(struct ieee80211_sub_if_data *sdata,
 
 	ieee80211_stop_vif_queues(local, sdata,
 				  IEEE80211_QUEUE_STOP_REASON_IFTYPE_CHANGE);
-	synchronize_net();
-
+	/* do_stop will synchronize_rcu() first thing */
 	ieee80211_do_stop(sdata, false);
 
 	ieee80211_teardown_sdata(sdata);