From c73beace9b3954ec755d5f9a3fa8b4f7b69646f7 Mon Sep 17 00:00:00 2001 From: Amit Mehta Date: Wed, 6 Sep 2023 09:45:07 +0530 Subject: [PATCH] qcacmn: Fix direct return while calling dp_set_peer_freq Currently from dp_set_peer_param while calling dp_set_peer_freq there is direct return which can result in peer refleak. as there is reference taken in dp_set_peer_param. To fix the issue instead of direct return break and release reference. Change-Id: Ic3cfe993de64566afc13157810b80d3b3b28d244 CRs-Fixed: 3608000 --- dp/wifi3.0/dp_main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index f79d916794..a916736626 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -8066,6 +8066,7 @@ static QDF_STATUS dp_set_peer_param(struct cdp_soc_t *cdp_soc, uint8_t vdev_id, enum cdp_peer_param_type param, cdp_config_param_type val) { + QDF_STATUS status = QDF_STATUS_SUCCESS; struct dp_peer *peer = dp_peer_get_tgt_peer_hash_find((struct dp_soc *)cdp_soc, peer_mac, 0, vdev_id, @@ -8095,8 +8096,8 @@ static QDF_STATUS dp_set_peer_param(struct cdp_soc_t *cdp_soc, uint8_t vdev_id, txrx_peer->in_twt = !!(val.cdp_peer_param_in_twt); break; case CDP_CONFIG_PEER_FREQ: - return dp_set_peer_freq(cdp_soc, vdev_id, - peer_mac, param, val); + status = dp_set_peer_freq(cdp_soc, vdev_id, + peer_mac, param, val); break; default: break; @@ -8104,7 +8105,7 @@ static QDF_STATUS dp_set_peer_param(struct cdp_soc_t *cdp_soc, uint8_t vdev_id, dp_peer_unref_delete(peer, DP_MOD_ID_CDP); - return QDF_STATUS_SUCCESS; + return status; } #ifdef WLAN_FEATURE_11BE_MLO