qcacld-3.0: Using util API to check scan result
SCAN_EVENT_TYPE_DEQUEUED means this scan request have been dequeued in fw. Driver should close this session and free related resouce if recevie DEQUEUED. In sap_scan_event_callback and csr_scan_callback, those functions will return if receive DEQUEUED.Which cause memory leak. So using util_is_scan_success to check scan result in scan callback. And check sap resouce whether be freed when rmmod.If not clear it. Change-Id: Iaf1f077dd7221236944d94d2b543f4df63de29fd CRs-Fixed: 2242823
This commit is contained in:
@@ -49,6 +49,7 @@
|
||||
#include <wlan_objmgr_vdev_obj.h>
|
||||
#include <wlan_objmgr_pdev_obj.h>
|
||||
#include "wlan_reg_services_api.h"
|
||||
#include <wlan_scan_utils_api.h>
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Preprocessor Definitions and Constants
|
||||
@@ -1365,6 +1366,7 @@ void sap_scan_event_callback(struct wlan_objmgr_vdev *vdev,
|
||||
{
|
||||
uint32_t scan_id;
|
||||
uint8_t session_id;
|
||||
bool success = false;
|
||||
eCsrScanStatus scan_status = eCSR_SCAN_FAILURE;
|
||||
tHalHandle hal_handle;
|
||||
struct sap_context *sap_ctx = arg;
|
||||
@@ -1378,17 +1380,12 @@ void sap_scan_event_callback(struct wlan_objmgr_vdev *vdev,
|
||||
return;
|
||||
}
|
||||
|
||||
if ((event->type == SCAN_EVENT_TYPE_COMPLETED) &&
|
||||
((event->reason == SCAN_REASON_CANCELLED) ||
|
||||
(event->reason == SCAN_REASON_TIMEDOUT) ||
|
||||
(event->reason == SCAN_REASON_INTERNAL_FAILURE)))
|
||||
scan_status = eCSR_SCAN_FAILURE;
|
||||
else if ((event->type == SCAN_EVENT_TYPE_COMPLETED) &&
|
||||
(event->reason == SCAN_REASON_COMPLETED))
|
||||
scan_status = eCSR_SCAN_SUCCESS;
|
||||
else
|
||||
if (!util_is_scan_completed(event, &success))
|
||||
return;
|
||||
|
||||
if (success)
|
||||
scan_status = eCSR_SCAN_SUCCESS;
|
||||
|
||||
if (!sap_ctx->sap_acs_pre_start_bss)
|
||||
wlansap_scan_callback(hal_handle, arg, session_id, scan_id,
|
||||
scan_status);
|
||||
|
@@ -367,6 +367,12 @@ QDF_STATUS sap_deinit_ctx(struct sap_context *sap_ctx)
|
||||
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;
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user