Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 25380917 authored by Paul Zhang's avatar Paul Zhang Committed by Gerrit - the friendly Code Review server
Browse files

qcacld-3.0: fetch profile_data from right position

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
parent 582d6d03
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -832,7 +832,6 @@ 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;
@@ -840,12 +839,9 @@ int wma_profile_data_report_event_handler(void *handle, uint8_t *event_buf,
		wma_err("Invalid profile data event buf");
		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_err("FW bin count %d more than data %d in TLV hdr",
			 entries,
@@ -874,6 +870,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;