]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: ath12k: Validate peer_id before searching for peer
authorSriram R <quic_srirrama@quicinc.com>
Mon, 14 Jul 2025 11:14:38 +0000 (16:44 +0530)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Tue, 15 Jul 2025 16:17:15 +0000 (09:17 -0700)
In RX WBM error path, error packet is received with invalid
peer_id (0x3FFF) as there is no peer associated with that packet.
However, this invalid peer_id coincides with the ML peer_id valid
bit mask, causing an unnecessary search in the ML peer list.

Prevent searching the peer list for invalid peer_id and return NULL.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1

Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
Signed-off-by: Nagarajan Maran <nagarajan.maran@oss.qualcomm.com>
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Link: https://patch.msgid.link/20250714111438.1134438-1-nagarajan.maran@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/peer.c

index eb7aeff0149038e3082bf6034591c80e407d10c6..f1ae9e5b5af7208e9a547b5c191b0dd3b582b295 100644 (file)
@@ -100,6 +100,9 @@ struct ath12k_peer *ath12k_peer_find_by_id(struct ath12k_base *ab,
 
        lockdep_assert_held(&ab->base_lock);
 
+       if (peer_id == HAL_INVALID_PEERID)
+               return NULL;
+
        if (peer_id & ATH12K_PEER_ML_ID_VALID)
                return ath12k_peer_find_by_ml_id(ab, peer_id);