wifi: iwlwifi: mvm: Do not warn on invalid link on scan complete
authorIlan Peer <ilan.peer@intel.com>
Tue, 19 Mar 2024 08:10:25 +0000 (10:10 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 25 Mar 2024 14:39:11 +0000 (15:39 +0100)
As it is possible that by the time the scan is completed the link was
already removed.

Fixes: 3a5a5cb06700 ("wifi: iwlwifi: mvm: Correctly report TSF data in scan complete")
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240319100755.619d3574a757.I0523e92547f0288c8b0119b1fdc5e967a5a8956e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/scan.c

index 459adba41ca63354d4fa360d60e930f303e8dac1..fc6b4f699cb666f72285cf49975738b420cbaf8c 100644 (file)
@@ -3207,8 +3207,13 @@ void iwl_mvm_rx_umac_scan_complete_notif(struct iwl_mvm *mvm,
                struct iwl_mvm_vif_link_info *link_info =
                        scan_vif->link[mvm->scan_link_id];
 
-               if (!WARN_ON(!link_info))
+               /* It is possible that by the time the scan is complete the link
+                * was already removed and is not valid.
+                */
+               if (link_info)
                        memcpy(info.tsf_bssid, link_info->bssid, ETH_ALEN);
+               else
+                       IWL_DEBUG_SCAN(mvm, "Scan link is no longer valid\n");
 
                ieee80211_scan_completed(mvm->hw, &info);
                mvm->scan_vif = NULL;