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

Commit 9a13c2ae authored by Paul Zhang's avatar Paul Zhang Committed by Madan Koyyalamudi
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 0dfce398
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -805,7 +805,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;
@@ -813,12 +812,9 @@ int wma_profile_data_report_event_handler(void *handle, uint8_t *event_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,
@@ -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;