wifi: iwlwifi: mld: assume wiphy is locked when getting BSS ifaces
authorBenjamin Berg <benjamin.berg@intel.com>
Sun, 9 Mar 2025 05:36:43 +0000 (07:36 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 11 Mar 2025 15:29:24 +0000 (16:29 +0100)
The code was calling ieee80211_iterate_interfaces, however that
takes a lock of iflist_mtx, which must not be taken recursively. Fix
this by using the appropriate _mtx version that asserts that the wiphy
mutex is already held.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250309073442.6ce298d6a44f.Ibc862dfdd6cb2da63781c791b9dc601bd5ce4bdc@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mld/iface.c

index 691062b44461909c2096af334a1104c9b1d06583..e49e2260ac05ebb8501aafbd1f309ed6ca1ca0f5 100644 (file)
@@ -465,10 +465,10 @@ u8 iwl_mld_get_fw_bss_vifs_ids(struct iwl_mld *mld)
 {
        u8 fw_id_bitmap = 0;
 
-       ieee80211_iterate_interfaces(mld->hw,
-                                    IEEE80211_IFACE_SKIP_SDATA_NOT_IN_DRIVER,
-                                    iwl_mld_get_fw_id_bss_bitmap_iter,
-                                    &fw_id_bitmap);
+       ieee80211_iterate_active_interfaces_mtx(mld->hw,
+                                               IEEE80211_IFACE_SKIP_SDATA_NOT_IN_DRIVER,
+                                               iwl_mld_get_fw_id_bss_bitmap_iter,
+                                               &fw_id_bitmap);
 
        return fw_id_bitmap;
 }