wifi: iwlwifi: mvm: fix the key PN index
authorShaul Triebitz <shaul.triebitz@intel.com>
Mon, 5 Feb 2024 19:21:09 +0000 (21:21 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 8 Feb 2024 14:00:47 +0000 (15:00 +0100)
commitf05ef3497f260d0ab75aed45205bfe90beb3bd90
tree3cff003328abc8a0451d53e91ed7475a030d4dca
parentb7acc059a728b591f1a27da0bfd460b0513fda7d
wifi: iwlwifi: mvm: fix the key PN index

When waking from D3 (and a GTK rekey happened during
D3), the key itself is saved in iwl_wowlan_status_data::gtk
array, but the PN is saved in iwl_wowlan_status_data::gtk_seq
array.
The indices (of the same key) might differ in both arrays.
Fix using the gtk array index in the gtk_seq array.
Rather, iterate and search for the correct key in the
gtk_seq array.

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240205211151.bdd0511c007d.I3325288c64c010a4d008ac4429de1c2b14ef764c@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/d3.c