From 8e8bcdca6422700f02f6ae1396cd1221c86c7d88 Mon Sep 17 00:00:00 2001 From: Paul Zhang Date: Mon, 7 Mar 2022 09:54:27 +0800 Subject: [PATCH] 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 --- wmi/src/wmi_unified_tlv.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 23487b0be26b..8e72ec1519df 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -1,5 +1,6 @@ /* * 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 = ¶m_buf->profile_data[idx]; profile_data->id = ev->id; profile_data->cnt = ev->cnt; profile_data->tot = ev->tot;