summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCen Zhang <zzzccc427@gmail.com>2026-07-06 20:37:56 +0800
committerJohannes Berg <johannes.berg@intel.com>2026-07-07 10:16:11 +0200
commitcffd0d2ed5f2603ef147fc8b625ca84b4041f5bf (patch)
treeb8e0b48c04f23b9b9844e897baba0a57f86b4888
parentf9202a374ec34e767185cf44f44ed2fbdf6bf053 (diff)
downloadlinux-cffd0d2ed5f2603ef147fc8b625ca84b4041f5bf.tar.gz
linux-cffd0d2ed5f2603ef147fc8b625ca84b4041f5bf.zip
wifi: mac80211_hwsim: clean up radio rhashtable on free
mac80211_hwsim_free() removes each radio from hwsim_radios before calling mac80211_hwsim_del_radio(), but leaves the matching hwsim_radios_rht entry in place until the whole table is destroyed. Other radio removal paths remove both the list entry and data->rht while holding hwsim_radio_lock, before dropping the lock and deleting the radio. Do the same here so the all-radio cleanup path follows the same object visibility ordering. This helper is used while all radios are being torn down, either after callback users have already been unregistered or while module init is unwinding, so no hwsim_radios_generation update is needed. Assisted-by: Codex:gpt-5.5 Signed-off-by: Cen Zhang <zzzccc427@gmail.com> Link: https://patch.msgid.link/20260706123756.343818-1-zzzccc427@gmail.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--drivers/net/wireless/virtual/mac80211_hwsim_main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wireless/virtual/mac80211_hwsim_main.c b/drivers/net/wireless/virtual/mac80211_hwsim_main.c
index 0dd8a6c85953..5c59c1a8e720 100644
--- a/drivers/net/wireless/virtual/mac80211_hwsim_main.c
+++ b/drivers/net/wireless/virtual/mac80211_hwsim_main.c
@@ -6274,6 +6274,8 @@ static void mac80211_hwsim_free(void)
struct mac80211_hwsim_data,
list))) {
list_del(&data->list);
+ rhashtable_remove_fast(&hwsim_radios_rht, &data->rht,
+ hwsim_rht_params);
spin_unlock_bh(&hwsim_radio_lock);
mac80211_hwsim_del_radio(data, wiphy_name(data->hw->wiphy),
NULL);