From 0411bc9be09019c4d21c4d12f7a707e7c2df07ea Mon Sep 17 00:00:00 2001 From: Jiachao Wu Date: Tue, 21 Nov 2017 10:43:27 +0800 Subject: [PATCH] qcacld-3.0: Fix a memory leak in hdd_assoc handler Function wlan_hdd_cfg80211_update_bss_db will return pointer of struct cfg80211_bss. Caller should invoke cfg80211_put_bss to free resource in pointer. In some case those resource not be free. Change-Id: I7fa55a09fcc3515361e9568cf87966e4533085e4 CRs-Fixed: 2146717 --- core/hdd/src/wlan_hdd_assoc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index d1ad45887190..9f6de4ba7e96 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -2787,6 +2787,10 @@ hdd_association_completion_handler(struct hdd_adapter *adapter, eCSR_DISCONNECT_REASON_UNSPECIFIED); } return QDF_STATUS_E_FAILURE; + } else { + cfg80211_put_bss( + hdd_ctx->wiphy, + bss); } if (roam_info->u.pConnectedProfile->AuthType == eCSR_AUTH_TYPE_FT_RSN @@ -3003,10 +3007,6 @@ hdd_association_completion_handler(struct hdd_adapter *adapter, } } if (!hddDisconInProgress) { - cfg80211_put_bss( - hdd_ctx->wiphy, - bss); - /* * Perform any WMM-related association * processing.