]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 May 2024 07:49:05 +0000 (09:49 +0200)
[ Upstream commit 1c78d39f4ede227e50e36165b3a76bc7c37ead02 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/intel/iwlwifi/mvm/scan.c

index 97d44354dbbb58639b19c8251e623709cefe4478..3dc6fb0600aaedd529d2e026c8f24fce432d492c 100644 (file)
@@ -3173,8 +3173,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;