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
This commit is contained in:
Yu Ouyang
2022-01-21 11:07:40 +08:00
committed by Madan Koyyalamudi
parent 183a762fdf
commit bb202375fe

View File

@@ -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);
}