From: Sriram R Date: Mon, 14 Jul 2025 11:14:38 +0000 (+0530) Subject: wifi: ath12k: Validate peer_id before searching for peer X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=136aad17e14250c815dcfc2e3cf9926e763b7436;p=users%2Fjedix%2Flinux-maple.git wifi: ath12k: Validate peer_id before searching for peer 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 Signed-off-by: Nagarajan Maran Reviewed-by: Vasanthakumar Thiagarajan Link: https://patch.msgid.link/20250714111438.1134438-1-nagarajan.maran@oss.qualcomm.com Signed-off-by: Jeff Johnson --- diff --git a/drivers/net/wireless/ath/ath12k/peer.c b/drivers/net/wireless/ath/ath12k/peer.c index eb7aeff014903..f1ae9e5b5af72 100644 --- a/drivers/net/wireless/ath/ath12k/peer.c +++ b/drivers/net/wireless/ath/ath12k/peer.c @@ -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);