qcacmn: Fix memory leak at policy manager initialization

Fix memory leak in policy manager init/deinit sequence.

Change-Id: I3c1728f2becb16b415f532acf657c7c29dc76122
CRs-Fixed: 2009818
This commit is contained in:
Tushnim Bhattacharyya
2017-04-27 11:49:06 -07:00
committed by snandini
parent d54693fe79
commit b3cbf84777
2 changed files with 45 additions and 7 deletions

View File

@@ -249,6 +249,18 @@ static QDF_STATUS dispatcher_policy_mgr_deinit(void)
return policy_mgr_deinit();
}
static QDF_STATUS dispatcher_policy_mgr_psoc_open(
struct wlan_objmgr_psoc *psoc)
{
return policy_mgr_psoc_open(psoc);
}
static QDF_STATUS dispatcher_policy_mgr_psoc_close(
struct wlan_objmgr_psoc *psoc)
{
return policy_mgr_psoc_close(psoc);
}
static QDF_STATUS dispatcher_policy_mgr_psoc_enable(
struct wlan_objmgr_psoc *psoc)
{
@@ -271,6 +283,18 @@ static QDF_STATUS dispatcher_policy_mgr_deinit(void)
return QDF_STATUS_SUCCESS;
}
static QDF_STATUS dispatcher_policy_mgr_psoc_open(
struct wlan_objmgr_psoc *psoc)
{
return QDF_STATUS_SUCCESS;
}
static QDF_STATUS dispatcher_policy_mgr_psoc_close(
struct wlan_objmgr_psoc *psoc)
{
return QDF_STATUS_SUCCESS;
}
static QDF_STATUS dispatcher_policy_mgr_psoc_enable(
struct wlan_objmgr_psoc *psoc)
{
@@ -659,12 +683,17 @@ QDF_STATUS dispatcher_psoc_open(struct wlan_objmgr_psoc *psoc)
if (QDF_STATUS_SUCCESS != atf_psoc_open(psoc))
goto atf_psoc_open_fail;
if (QDF_STATUS_SUCCESS != dispatcher_policy_mgr_psoc_open(psoc))
goto policy_mgr_psoc_open_fail;
if (QDF_STATUS_SUCCESS != dispatcher_regulatory_psoc_open(psoc))
goto regulatory_psoc_open_fail;
return QDF_STATUS_SUCCESS;
regulatory_psoc_open_fail:
dispatcher_policy_mgr_psoc_close(psoc);
policy_mgr_psoc_open_fail:
atf_psoc_close(psoc);
atf_psoc_open_fail:
wlan_serialization_psoc_close(psoc);
@@ -684,6 +713,8 @@ QDF_STATUS dispatcher_psoc_close(struct wlan_objmgr_psoc *psoc)
{
QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_regulatory_psoc_close(psoc));
QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_policy_mgr_psoc_close(psoc));
QDF_BUG(QDF_STATUS_SUCCESS == atf_psoc_close(psoc));
QDF_BUG(QDF_STATUS_SUCCESS == wlan_serialization_psoc_close(psoc));

View File

@@ -324,7 +324,20 @@ QDF_STATUS policy_mgr_psoc_open(struct wlan_objmgr_psoc *psoc)
QDF_STATUS policy_mgr_psoc_close(struct wlan_objmgr_psoc *psoc)
{
/* placeholder for now */
struct policy_mgr_psoc_priv_obj *pm_ctx;
pm_ctx = policy_mgr_get_context(psoc);
if (!pm_ctx) {
policy_mgr_err("Invalid Context");
return QDF_STATUS_E_FAILURE;
}
if (pm_ctx->hw_mode.hw_mode_list) {
qdf_mem_free(pm_ctx->hw_mode.hw_mode_list);
pm_ctx->hw_mode.hw_mode_list = NULL;
policy_mgr_info("HW list is freed");
}
return QDF_STATUS_SUCCESS;
}
@@ -427,12 +440,6 @@ QDF_STATUS policy_mgr_psoc_disable(struct wlan_objmgr_psoc *psoc)
return QDF_STATUS_E_FAILURE;
}
if (pm_ctx->hw_mode.hw_mode_list) {
qdf_mem_free(pm_ctx->hw_mode.hw_mode_list);
pm_ctx->hw_mode.hw_mode_list = NULL;
policy_mgr_info("HW list is freed");
}
if (!QDF_IS_STATUS_SUCCESS(qdf_mutex_destroy(
&pm_ctx->qdf_conc_list_lock))) {
policy_mgr_err("Failed to destroy qdf_conc_list_lock");