From f8074d87b24989cb6919d5c3bb1cb6bb44ec0703 Mon Sep 17 00:00:00 2001 From: Aditya Sathish Date: Wed, 13 Feb 2019 15:28:49 +0530 Subject: [PATCH] qcacmn: Add return path for fc_peer_stats for peer mac address Add return path for fc_peer_stats for peer mac address if the peer is connected to another pdev. The DP peers are maintained at the SOC as such there is no check to make sure that the peer is for a particular pdev. This issue is especially seen when an end user invokes fc_peer_stats in wifi0 for a peer that is connected to wifi1. In such a case, we should be returning an error since the peer is not connected to the pdev that the user application is directed to. Change-Id: Ie1142c508605bfcf2fd49adc863879eee98fffe6 CRs-Fixed: 2397052 --- dp/wifi3.0/dp_main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 4ead51293b3c..43fbcb266699 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -7199,6 +7199,13 @@ dp_get_host_peer_stats(struct cdp_pdev *pdev_handle, char *mac_addr) return; } + /* Making sure the peer is for the specific pdev */ + if ((struct dp_pdev *)pdev_handle != peer->vdev->pdev) { + QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, + "%s: Peer is not for this pdev\n", __func__); + return; + } + dp_print_peer_stats(peer); dp_peer_rxtid_stats(peer, dp_rx_tid_stats_cb, NULL); }