summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKabilan Kannan <kabilank@codeaurora.org>2018-06-12 17:22:33 -0700
committernshrivas <nshrivas@codeaurora.org>2018-07-11 19:52:32 -0700
commit9a55b4431d85ddd21967a585715c7c8e3e49740b (patch)
tree017b885a7c54797d5bf9aef309a26c318115e8f0
parent4bbbebcc0bf471307a7f9e140903c71be6d708ed (diff)
qcacld-3.0: Validate SAR2 response event handle
Validate SAR2 response event handle and pass the valid pointer for result extraction. Change-Id: I91982c411c77494662f6d00de6078622a3d548ae CRs-Fixed: 2259373
-rw-r--r--core/wma/inc/wma_internal.h4
-rw-r--r--core/wma/src/wma_features.c20
2 files changed, 20 insertions, 4 deletions
diff --git a/core/wma/inc/wma_internal.h b/core/wma/inc/wma_internal.h
index 2594a8aaea97..4af334a2100c 100644
--- a/core/wma/inc/wma_internal.h
+++ b/core/wma/inc/wma_internal.h
@@ -1233,13 +1233,13 @@ QDF_STATUS wma_set_led_flashing(tp_wma_handle wma_handle,
/**
* wma_sar_rsp_evt_handler() - process sar response event from FW.
- * @handle: wma handle
+ * @scn_handle: scn handle
* @event: event buffer
* @len: buffer length
*
* Return: 0 for success or error code
*/
-int wma_sar_rsp_evt_handler(void *handle, uint8_t *event, uint32_t len);
+int wma_sar_rsp_evt_handler(ol_scn_t scn_handle, uint8_t *event, uint32_t len);
#ifdef FEATURE_WLAN_CH_AVOID
int wma_channel_avoid_evt_handler(void *handle, uint8_t *event,
diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c
index 2f7820deacfd..f577da257a05 100644
--- a/core/wma/src/wma_features.c
+++ b/core/wma/src/wma_features.c
@@ -8232,11 +8232,27 @@ QDF_STATUS wma_set_led_flashing(tp_wma_handle wma_handle,
}
#endif /* WLAN_FEATURE_GPIO_LED_FLASHING */
-int wma_sar_rsp_evt_handler(void *handle, uint8_t *event, uint32_t len)
+int wma_sar_rsp_evt_handler(ol_scn_t handle, uint8_t *event, uint32_t len)
{
+ tp_wma_handle wma_handle;
+ wmi_unified_t wmi_handle;
QDF_STATUS status;
- status = wmi_unified_extract_sar2_result_event(handle,
+ WMA_LOGD(FL("handle:%pK event:%pK len:%u"), handle, event, len);
+
+ wma_handle = handle;
+ if (!wma_handle) {
+ WMA_LOGE(FL("NULL wma_handle"));
+ return QDF_STATUS_E_INVAL;
+ }
+
+ wmi_handle = wma_handle->wmi_handle;
+ if (!wmi_handle) {
+ WMA_LOGE(FL("NULL wmi_handle"));
+ return QDF_STATUS_E_INVAL;
+ }
+
+ status = wmi_unified_extract_sar2_result_event(wmi_handle,
event, len);
if (QDF_IS_STATUS_ERROR(status)) {
WMA_LOGE(FL("Event extract failure: %d"), status);