summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorAlexander Wetzel <Alexander@wetzel-home.de>2025-02-04 17:42:40 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-04-10 14:39:28 +0200
commite0862a6d3dabddbfaa44990a950f131c88d467cb (patch)
treea01c5b6fac74baf1555e35a92f0aa481a6ce64fb /net
parent5d42a34137243b1d86acf02b49963c529ff6ea3e (diff)
downloadlinux-e0862a6d3dabddbfaa44990a950f131c88d467cb.tar.gz
linux-e0862a6d3dabddbfaa44990a950f131c88d467cb.tar.bz2
linux-e0862a6d3dabddbfaa44990a950f131c88d467cb.zip
wifi: mac80211: remove debugfs dir for virtual monitor
[ Upstream commit 646262c71aca87bb66945933abe4e620796d6c5a ] Don't call ieee80211_debugfs_recreate_netdev() for virtual monitor interface when deleting it. The virtual monitor interface shouldn't have debugfs entries and trying to update them will *create* them on deletion. And when the virtual monitor interface is created/destroyed multiple times we'll get warnings about debugfs name conflicts. Signed-off-by: Alexander Wetzel <Alexander@wetzel-home.de> Link: https://patch.msgid.link/20250204164240.370153-1-Alexander@wetzel-home.de Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/driver-ops.c10
-rw-r--r--net/mac80211/iface.c11
2 files changed, 14 insertions, 7 deletions
diff --git a/net/mac80211/driver-ops.c b/net/mac80211/driver-ops.c
index fe868b521622..9b7d09994820 100644
--- a/net/mac80211/driver-ops.c
+++ b/net/mac80211/driver-ops.c
@@ -115,8 +115,14 @@ void drv_remove_interface(struct ieee80211_local *local,
sdata->flags &= ~IEEE80211_SDATA_IN_DRIVER;
- /* Remove driver debugfs entries */
- ieee80211_debugfs_recreate_netdev(sdata, sdata->vif.valid_links);
+ /*
+ * Remove driver debugfs entries.
+ * The virtual monitor interface doesn't get a debugfs
+ * entry, so it's exempt here.
+ */
+ if (sdata != local->monitor_sdata)
+ ieee80211_debugfs_recreate_netdev(sdata,
+ sdata->vif.valid_links);
trace_drv_remove_interface(local, sdata);
local->ops->remove_interface(&local->hw, &sdata->vif);
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index af9055252e6d..8bbfa45e1796 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -1205,16 +1205,17 @@ void ieee80211_del_virtual_monitor(struct ieee80211_local *local)
return;
}
- RCU_INIT_POINTER(local->monitor_sdata, NULL);
- mutex_unlock(&local->iflist_mtx);
-
- synchronize_net();
-
+ clear_bit(SDATA_STATE_RUNNING, &sdata->state);
ieee80211_link_release_channel(&sdata->deflink);
if (ieee80211_hw_check(&local->hw, WANT_MONITOR_VIF))
drv_remove_interface(local, sdata);
+ RCU_INIT_POINTER(local->monitor_sdata, NULL);
+ mutex_unlock(&local->iflist_mtx);
+
+ synchronize_net();
+
kfree(sdata);
}