Skip to content

Commit

Permalink
wifi: iwlwifi: mvm: use correct key iteration
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Miri Korenblit <[email protected]>
Link: https://patch.msgid.link/20240729201718.69a2d18580c1.I2148e04d4b467d0b100beac8f7e449bfaaf775a5@changeid
Signed-off-by: Johannes Berg <[email protected]>
  • Loading branch information
jmberg-intel committed Aug 27, 2024
1 parent cb2b6ce commit 4f1591d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down Expand Up @@ -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);
}

0 comments on commit 4f1591d

Please sign in to comment.