linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH ath-next v2] wifi: ath12k: Validate peer_id before searching for peer
@ 2025-07-14 11:14 Nagarajan Maran
  2025-07-15  3:03 ` Vasanthakumar Thiagarajan
  2025-07-15 16:24 ` Jeff Johnson
  0 siblings, 2 replies; 3+ messages in thread
From: Nagarajan Maran @ 2025-07-14 11:14 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless, Sriram R, Nagarajan Maran

From: Sriram R <quic_srirrama@quicinc.com>

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>
---
Changes in v2:
	- Corrected Signed-off-by tag
---
 drivers/net/wireless/ath/ath12k/peer.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/wireless/ath/ath12k/peer.c b/drivers/net/wireless/ath/ath12k/peer.c
index ec7236bbccc0..1a098cb22933 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);
 

base-commit: 7e22b60a8af12b81ff3d416ed4e7d21fb98e9f25
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH ath-next v2] wifi: ath12k: Validate peer_id before searching for peer
  2025-07-14 11:14 [PATCH ath-next v2] wifi: ath12k: Validate peer_id before searching for peer Nagarajan Maran
@ 2025-07-15  3:03 ` Vasanthakumar Thiagarajan
  2025-07-15 16:24 ` Jeff Johnson
  1 sibling, 0 replies; 3+ messages in thread
From: Vasanthakumar Thiagarajan @ 2025-07-15  3:03 UTC (permalink / raw)
  To: Nagarajan Maran, ath12k; +Cc: linux-wireless, Sriram R



On 7/14/2025 4:44 PM, Nagarajan Maran wrote:
> From: Sriram R <quic_srirrama@quicinc.com>
> 
> 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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH ath-next v2] wifi: ath12k: Validate peer_id before searching for peer
  2025-07-14 11:14 [PATCH ath-next v2] wifi: ath12k: Validate peer_id before searching for peer Nagarajan Maran
  2025-07-15  3:03 ` Vasanthakumar Thiagarajan
@ 2025-07-15 16:24 ` Jeff Johnson
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Johnson @ 2025-07-15 16:24 UTC (permalink / raw)
  To: ath12k, Nagarajan Maran; +Cc: linux-wireless, Sriram R


On Mon, 14 Jul 2025 16:44:38 +0530, Nagarajan Maran wrote:
> 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.
> 
> [...]

Applied, thanks!

[1/1] wifi: ath12k: Validate peer_id before searching for peer
      commit: 136aad17e14250c815dcfc2e3cf9926e763b7436

Best regards,
-- 
Jeff Johnson <jeff.johnson@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-07-15 16:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-14 11:14 [PATCH ath-next v2] wifi: ath12k: Validate peer_id before searching for peer Nagarajan Maran
2025-07-15  3:03 ` Vasanthakumar Thiagarajan
2025-07-15 16:24 ` Jeff Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).