mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 23:24:22 -04:00
qcacld-3.0: Handle beacon memory leak in SAP mode
Free the beacon memory during hdd_sap_destroy_ctx if it is not already freed. Change-Id: Ib941878e0402c48f4eacbd8593822d35f4e6dac1 CRs-Fixed: 2691300
This commit is contained in:
parent
e95713a94e
commit
13b5b00850
1 changed files with 12 additions and 3 deletions
|
|
@ -298,11 +298,10 @@ static int hdd_hostapd_deinit_sap_session(struct hdd_adapter *adapter)
|
|||
status = -EINVAL;
|
||||
}
|
||||
|
||||
if (!QDF_IS_STATUS_SUCCESS(sap_destroy_ctx(sap_ctx))) {
|
||||
if (!hdd_sap_destroy_ctx(adapter)) {
|
||||
hdd_err("Error closing the sap session");
|
||||
status = -EINVAL;
|
||||
}
|
||||
adapter->session.ap.sap_context = NULL;
|
||||
|
||||
if (!QDF_IS_STATUS_SUCCESS(status))
|
||||
hdd_debug("sap has issue closing the session");
|
||||
|
|
@ -3384,8 +3383,18 @@ bool hdd_sap_create_ctx(struct hdd_adapter *adapter)
|
|||
|
||||
bool hdd_sap_destroy_ctx(struct hdd_adapter *adapter)
|
||||
{
|
||||
struct sap_context *sap_ctx = adapter->session.ap.sap_context;
|
||||
|
||||
if (adapter->session.ap.beacon) {
|
||||
qdf_mem_free(adapter->session.ap.beacon);
|
||||
adapter->session.ap.beacon = NULL;
|
||||
}
|
||||
|
||||
hdd_debug("destroying sap context");
|
||||
sap_destroy_ctx(adapter->session.ap.sap_context);
|
||||
|
||||
if (QDF_IS_STATUS_ERROR(sap_destroy_ctx(sap_ctx)))
|
||||
return false;
|
||||
|
||||
adapter->session.ap.sap_context = NULL;
|
||||
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue