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

Commit 8e8bcdca authored by Paul Zhang's avatar Paul Zhang
Browse files

qcacmn: 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.

Change-Id: I2928f89a14646fceb93729f508b817c173eff1a2
CRs-Fixed: 3136679
parent 8570f5c3
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
/*
 * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
@@ -10695,7 +10696,6 @@ static QDF_STATUS extract_profile_data_tlv(wmi_unified_t wmi_handle,
{
	WMI_WLAN_PROFILE_DATA_EVENTID_param_tlvs *param_buf;
	wmi_wlan_profile_t *ev;
	uint8_t *buf_ptr;

	param_buf = (WMI_WLAN_PROFILE_DATA_EVENTID_param_tlvs *)evt_buf;
	if (!param_buf) {
@@ -10703,12 +10703,7 @@ static QDF_STATUS extract_profile_data_tlv(wmi_unified_t wmi_handle,
		return QDF_STATUS_E_INVAL;
	}

	buf_ptr = (uint8_t *)param_buf->profile_ctx;
	buf_ptr = buf_ptr + sizeof(wmi_wlan_profile_ctx_t) + WMI_TLV_HDR_SIZE;

	buf_ptr = buf_ptr + (sizeof(wmi_wlan_profile_t) * idx);
	ev = (wmi_wlan_profile_t *)buf_ptr;

	ev = &param_buf->profile_data[idx];
	profile_data->id  = ev->id;
	profile_data->cnt = ev->cnt;
	profile_data->tot = ev->tot;