qcacld-3.0: Fix psoc ref count leak in wma_open

In wma_open, first get ref of psoc, then attach wmi, if attach
failed, should release ref of psoc before return

Change-Id: If2e21bbf8b54de865c2b54582685974474ea3c7c
CRs-Fixed: 2250872
This commit is contained in:
Zhu Jianmin 2018-05-30 16:20:24 +08:00 • committed by nshrivas
commit f9e2e2d18f

View file

@ -3114,7 +3114,7 @@ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc,
qdf_status = wlan_objmgr_psoc_try_get_ref(psoc, WLAN_LEGACY_WMA_ID);
if (QDF_IS_STATUS_ERROR(qdf_status)) {
WMA_LOGE("%s: PSOC get_ref fails", __func__);
goto err_wma_handle;
goto err_get_psoc_ref;
}
wma_handle->psoc = psoc;
@ -3585,6 +3585,8 @@ err_scn_context:
err_wma_handle:
target_if_close();
wlan_objmgr_psoc_release_ref(psoc, WLAN_LEGACY_WMA_ID);
err_get_psoc_ref:
target_if_free_psoc_tgt_info(psoc);
if (cds_get_conparam() != QDF_GLOBAL_FTM_MODE) {
#ifdef FEATURE_WLAN_EXTSCAN