diff options
author | Rajeev Kumar <quic_rajekuma@quicinc.com> | 2020-04-11 15:35:31 +0530 |
---|---|---|
committer | Paul Chen <chenpaul@google.com> | 2020-05-19 05:28:51 +0000 |
commit | 0b7a7b5b2a796a1481d73ce3a484c4601c729f53 (patch) | |
tree | 0e9587674459fc48f5d61a41ec834d99c87946bd | |
parent | 74c92077fbe390de39ac9a9ee37d7b534cd8ca06 (diff) | |
download | qcacld-0b7a7b5b2a796a1481d73ce3a484c4601c729f53.tar.gz |
qcacld-3.0: Check for objmgr peer entry in wma_remove_peer
Currently, NDP peer entry is cached in dph table when an NDP
indication is received. Existence of this entry in the table
is used to know if the NDP session is still valid and peer cleanup
happens based on that. It removes the entry from dph table once the
cleanup is done in WMA_DELETE_STA_RSP handler. Below are the two
cases to initiate cleanup on an NDP,
1. When NDP_END indication is received from firmware
2. When NDP confirm is received with a failure from firmware
There can be a scenario where these two events happen back to
back for the same peer. An event might attempt to remove peer with
wma_remove_peer while the other event has already removed and just
before deleting the entry from dph table.
So check for the existence of peer entry in objmgr in
wma_remove_peer before proceeding for the peer removal. Try to
remove peer only if it's present.
Bug: 154027437
Change-Id: I473a4608939f1ad919d93e065b7deaa9ff2da5a7
CRs-Fixed: 2653662
Signed-off-by: Rajeev Kumar <quic_rajekuma@quicinc.com>
-rw-r--r-- | core/wma/src/wma_dev_if.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index 417545ab08..32ed2ed49c 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -1481,6 +1481,24 @@ QDF_STATUS wma_peer_unmap_conf_cb(uint8_t vdev_id, return qdf_status; } +static bool wma_objmgr_peer_exist(tp_wma_handle wma, uint8_t vdev_id, + uint8_t *peer_addr, uint8_t *peer_vdev_id) +{ + struct wlan_objmgr_peer *peer; + + peer = wlan_objmgr_get_peer_by_mac(wma->psoc, peer_addr, + WLAN_LEGACY_WMA_ID); + if (!peer) + return false; + + if (peer_vdev_id) + *peer_vdev_id = wlan_vdev_get_id(wlan_peer_get_vdev(peer)); + + wlan_objmgr_peer_release_ref(peer, WLAN_LEGACY_WMA_ID); + + return true; +} + /** * wma_remove_peer() - remove peer information from host driver and fw * @wma: wma handle @@ -1526,6 +1544,13 @@ QDF_STATUS wma_remove_peer(tp_wma_handle wma, uint8_t *bssid, WMA_LOGE("%s: PEER is NULL for vdev_id: %d", __func__, vdev_id); return QDF_STATUS_E_INVAL; } + + if (!wma_objmgr_peer_exist(wma, vdev_id, peer_addr, NULL)) { + wma_err("peer doesn't exist peer_addr %pM vdevid %d peer_count %d", + peer_addr, vdev_id, + wma->interfaces[vdev_id].peer_count); + return QDF_STATUS_E_INVAL; + } peer_unmap_conf_support_enabled = cdp_cfg_get_peer_unmap_conf_support(soc); |