qcacld-3.0: Fix memory leak of sap_ctx->channelList

In sap_deinit_ctx() the check to free sap_ctx->channelList is after
sap_ctx is memset to 0 and thus sap_ctx->channelList will always be
NULL and memory will never get freed.

Also there is no need to reset scan_vdev_del_in_progress after vdev
is deleted in firmware as there still can be the race when scan is
processed. scan_vdev_del_in_progress will be deleted with obj_mgr
vdev so no need to reset it.

Change-Id: Ie5f133d4db48485434436e67ce1643d8e1e04106
CRs-Fixed: 2342039
This commit is contained in:
Abhishek Singh 2018-10-31 20:20:20 +05:30 • committed by nshrivas
commit 8d11564b56
2 changed files with 5 additions and 6 deletions

View file

@ -3794,7 +3794,6 @@ int hdd_vdev_destroy(struct hdd_adapter *adapter)
}
release_vdev:
ucfg_scan_clear_vdev_del_in_progress(adapter->vdev);
/* do vdev logical destroy via objmgr */
errno = hdd_objmgr_release_and_destroy_vdev(adapter);

View file

@ -357,17 +357,17 @@ QDF_STATUS sap_deinit_ctx(struct sap_context *sap_ctx)
return QDF_STATUS_E_FAULT;
}
ucfg_scan_unregister_requester(pmac->psoc, sap_ctx->req_id);
sap_free_roam_profile(&sap_ctx->csr_roamProfile);
if (sap_ctx->sessionId != CSR_SESSION_ID_INVALID) {
/* empty queues/lists/pkts if any */
sap_clear_session_param(hal, sap_ctx, sap_ctx->sessionId);
}
if (sap_ctx->channelList) {
qdf_mem_free(sap_ctx->channelList);
sap_ctx->channelList = NULL;
sap_ctx->num_of_channel = 0;
}
sap_free_roam_profile(&sap_ctx->csr_roamProfile);
if (sap_ctx->sessionId != CSR_SESSION_ID_INVALID) {
/* empty queues/lists/pkts if any */
sap_clear_session_param(hal, sap_ctx, sap_ctx->sessionId);
}
return QDF_STATUS_SUCCESS;
}