]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: iwlwifi: mvm: use correct key iteration
authorJohannes Berg <johannes.berg@intel.com>
Mon, 29 Jul 2024 17:20:05 +0000 (20:20 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 27 Aug 2024 08:14:26 +0000 (10:14 +0200)
In the cases changed here, key iteration isn't done from
an RCU critical section, but rather using the wiphy lock
as protection. Therefore, just use ieee80211_iter_keys().
The link switch case can therefore also use sync commands.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20240729201718.69a2d18580c1.I2148e04d4b467d0b100beac8f7e449bfaaf775a5@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c

index 8a38fc4b0b0f973f464c8788a366437b55d8b1c3..455f5f41750642eb64e7ebe1597c3290a6b3d36c 100644 (file)
@@ -144,7 +144,7 @@ static void iwl_mvm_mld_update_sta_key(struct ieee80211_hw *hw,
        if (sta != data->sta || key->link_id >= 0)
                return;
 
-       err = iwl_mvm_send_cmd_pdu(mvm, cmd_id, CMD_ASYNC, sizeof(cmd), &cmd);
+       err = iwl_mvm_send_cmd_pdu(mvm, cmd_id, 0, sizeof(cmd), &cmd);
 
        if (err)
                data->err = err;
@@ -162,8 +162,8 @@ int iwl_mvm_mld_update_sta_keys(struct iwl_mvm *mvm,
                .new_sta_mask = new_sta_mask,
        };
 
-       ieee80211_iter_keys_rcu(mvm->hw, vif, iwl_mvm_mld_update_sta_key,
-                               &data);
+       ieee80211_iter_keys(mvm->hw, vif, iwl_mvm_mld_update_sta_key,
+                           &data);
        return data.err;
 }
 
@@ -402,7 +402,7 @@ void iwl_mvm_sec_key_remove_ap(struct iwl_mvm *mvm,
        if (!sec_key_ver)
                return;
 
-       ieee80211_iter_keys_rcu(mvm->hw, vif,
-                               iwl_mvm_sec_key_remove_ap_iter,
-                               (void *)(uintptr_t)link_id);
+       ieee80211_iter_keys(mvm->hw, vif,
+                           iwl_mvm_sec_key_remove_ap_iter,
+                           (void *)(uintptr_t)link_id);
 }