Skip to content

Commit

Permalink
qcacld-3.0: fetch profile_data from right position
Browse files Browse the repository at this point in the history
Since structure wmi_wlan_profile_t includes tlv header, it has
to consider the tlv header in each iteration.

CRs-Fixed: 3136374
Change-Id: I14a86ed14f616a5f1aaeabd25a81fa22d762ffe3
  • Loading branch information
Paul Zhang authored and Madan Koyyalamudi committed May 25, 2022
1 parent 0dfce39 commit 9a13c2a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions core/wma/src/wma_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -805,20 +805,16 @@ int wma_profile_data_report_event_handler(void *handle, uint8_t *event_buf,
wmi_wlan_profile_t *profile_data;
uint32_t i = 0;
uint32_t entries;
uint8_t *buf_ptr;
char temp_str[150];

param_buf = (WMI_WLAN_PROFILE_DATA_EVENTID_param_tlvs *) event_buf;
if (!param_buf) {
WMA_LOGE("%s: Invalid profile data event buf", __func__);
return -EINVAL;
}

profile_ctx = param_buf->profile_ctx;
buf_ptr = (uint8_t *)profile_ctx;
buf_ptr = buf_ptr + sizeof(wmi_wlan_profile_ctx_t) + WMI_TLV_HDR_SIZE;
profile_data = (wmi_wlan_profile_t *) buf_ptr;
entries = profile_ctx->bin_count;

if (entries > param_buf->num_profile_data) {
WMA_LOGE("FW bin count %d more than data %d in TLV hdr",
entries,
Expand Down Expand Up @@ -847,6 +843,7 @@ int wma_profile_data_report_event_handler(void *handle, uint8_t *event_buf,
QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_ERROR,
"Profile ID: Count: TOT: Min: Max: hist_intvl: hist[0]: hist[1]:hist[2]");

profile_data = param_buf->profile_data;
for (i = 0; i < entries; i++) {
if (i == WMI_WLAN_PROFILE_MAX_BIN_CNT)
break;
Expand Down

0 comments on commit 9a13c2a

Please sign in to comment.