Skip to content

Commit 646262c

Browse files
alexw65500jmberg-intel
authored andcommitted
wifi: mac80211: remove debugfs dir for virtual monitor
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>
1 parent 5b99900 commit 646262c

2 files changed

Lines changed: 14 additions & 7 deletions

File tree

net/mac80211/driver-ops.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,14 @@ void drv_remove_interface(struct ieee80211_local *local,
116116

117117
sdata->flags &= ~IEEE80211_SDATA_IN_DRIVER;
118118

119-
/* Remove driver debugfs entries */
120-
ieee80211_debugfs_recreate_netdev(sdata, sdata->vif.valid_links);
119+
/*
120+
* Remove driver debugfs entries.
121+
* The virtual monitor interface doesn't get a debugfs
122+
* entry, so it's exempt here.
123+
*/
124+
if (sdata != local->monitor_sdata)
125+
ieee80211_debugfs_recreate_netdev(sdata,
126+
sdata->vif.valid_links);
121127

122128
trace_drv_remove_interface(local, sdata);
123129
local->ops->remove_interface(&local->hw, &sdata->vif);

net/mac80211/iface.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,16 +1206,17 @@ void ieee80211_del_virtual_monitor(struct ieee80211_local *local)
12061206
return;
12071207
}
12081208

1209-
RCU_INIT_POINTER(local->monitor_sdata, NULL);
1210-
mutex_unlock(&local->iflist_mtx);
1211-
1212-
synchronize_net();
1213-
1209+
clear_bit(SDATA_STATE_RUNNING, &sdata->state);
12141210
ieee80211_link_release_channel(&sdata->deflink);
12151211

12161212
if (ieee80211_hw_check(&local->hw, WANT_MONITOR_VIF))
12171213
drv_remove_interface(local, sdata);
12181214

1215+
RCU_INIT_POINTER(local->monitor_sdata, NULL);
1216+
mutex_unlock(&local->iflist_mtx);
1217+
1218+
synchronize_net();
1219+
12191220
kfree(sdata);
12201221
}
12211222

0 commit comments

Comments
 (0)