diff options
| author | jiad <jiad@codeaurora.org> | 2018-01-15 15:56:26 +0800 |
|---|---|---|
| committer | snandini <snandini@codeaurora.org> | 2018-01-25 20:42:13 -0800 |
| commit | e2cfcc890c2b912e736d9164d7a233009cdbace2 (patch) | |
| tree | eac306d5d9d58d827169cb130e82a4962ec0052a | |
| parent | 77d3d654dc5b5b2d6ec4ae5cad62237f30b12a3e (diff) | |
qcacld-3.0: Fix sar_limit_event frame-larger-than build error
In wma_sar_event_handler, compiler with -Werror=frame-larger-than=
throws frame size larger than 1024 bytes build error.
Fix is to use heap memory for struct sar_limit_event.
Change-Id: Idd122b24a7e00b10404864e045eaa9df01852fd8
CRs-Fixed: 2177791
| -rw-r--r-- | core/wma/src/wma_features.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index 0c483aa94166..a74b975e4860 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -10367,7 +10367,7 @@ static int wma_sar_event_handler(void *handle, uint8_t *evt_buf, uint32_t len) { tp_wma_handle wma_handle; wmi_unified_t wmi_handle; - struct sar_limit_event event; + struct sar_limit_event *event; wma_sar_cb callback; QDF_STATUS status; @@ -10385,17 +10385,26 @@ static int wma_sar_event_handler(void *handle, uint8_t *evt_buf, uint32_t len) return QDF_STATUS_E_INVAL; } + event = qdf_mem_malloc(sizeof(*event)); + if (!event) { + WMA_LOGE(FL("failed to malloc sar_limit_event")); + return QDF_STATUS_E_NOMEM; + } + status = wmi_unified_extract_sar_limit_event(wmi_handle, - evt_buf, &event); + evt_buf, event); if (QDF_IS_STATUS_ERROR(status)) { WMA_LOGE(FL("Event extract failure: %d"), status); + qdf_mem_free(event); return QDF_STATUS_E_INVAL; } callback = sar_callback; sar_callback = NULL; if (callback) - callback(sar_context, &event); + callback(sar_context, event); + + qdf_mem_free(event); return 0; } |
