summary refs log tree commit diff
path: root/drivers
diff options
context:
space:
mode:
authorcnssbldsw <cnssbldsw@qualcomm.com>2023-12-20 14:55:54 +0800
committerPierre-Loup A. Griffais <git@plagman.net>2023-12-26 18:45:21 -0800
commitd9790ec9e288931bd83c14dd24620c541945fbea (patch)
treeb5367c85a47a669b9f6fca57ff06c16bc4c0dc81 /drivers
parentfe7a7dc337678b2c4b943880dbac8748976a2343 (diff)
downloadlinux-d9790ec9e288931bd83c14dd24620c541945fbea.tar.gz
wifi: ath11k: fix firmware crash due to invalid nss
Signed-off-by: cnssbldsw <cnssbldsw@qualcomm.com>
(cherry picked from commit 1c2b795d3e39b17476a3fb5b028fec1375d5a323)
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath11k/mac.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index e7b3b0dfe8f3..6bc6f4e9b03c 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -2304,7 +2304,7 @@ static void ath11k_peer_assoc_h_he(struct ath11k *ar,
 		    he_mcs_mask[i])
 			max_nss = i + 1;
 	}
-	arg->peer_nss = min(sta->deflink.rx_nss, max_nss);
+	arg->peer_nss = min(arg->peer_nss, (u32)max_nss);
 
 	if (arg->peer_phymode == MODE_11AX_HE160 ||
 	    arg->peer_phymode == MODE_11AX_HE80_80) {
@@ -4443,6 +4443,7 @@ static void ath11k_sta_rc_update_wk(struct work_struct *wk)
 	nss = min(nss, max(max(ath11k_mac_max_ht_nss(ht_mcs_mask),
 			       ath11k_mac_max_vht_nss(vht_mcs_mask)),
 			   ath11k_mac_max_he_nss(he_mcs_mask)));
+	nss = min(nss, (u32)ar->num_tx_chains);
 
 	if (changed & IEEE80211_RC_BW_CHANGED) {
 		/* Get the peer phymode */