From bb202375fecaf6fdabd2e33c8cf42d80040bb609 Mon Sep 17 00:00:00 2001 From: Yu Ouyang Date: Fri, 21 Jan 2022 11:07:40 +0800 Subject: [PATCH] qcacld-3.0: Avoid repeatedly call dump station API For AP/P2P GO mode, API wlan_hdd_cfg80211_dump_station() is designed to return multiple records in a loop until the last record is returned. So, return -ENOENT if there are no more entries to dump. For STA/P2P client mode, it is designed to return self record. Add checking index, it should return -ENOENT for station/p2p client mode if index not zero. Otherwise, kernel will repeatedly call dump API. Change-Id: Ic84c08c8edf5f0590c6e2aef97074097fd739798 CRs-Fixed: 3112477 --- core/hdd/src/wlan_hdd_stats.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index 722a505000..650ab48028 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -6174,6 +6174,9 @@ static int __wlan_hdd_cfg80211_dump_station(struct wiphy *wiphy, hdd_err("sap get peer info disabled!"); } } else { + if (idx != 0) + return -ENOENT; + qdf_mem_copy(mac, dev->dev_addr, QDF_MAC_ADDR_SIZE); errno = wlan_hdd_get_sta_stats(wiphy, adapter, mac, sinfo); }