qcacmn: Fix issue in extraction API for peer and vdev extd stats
wmi_stats_event structure is defined in FW header wmi_unified.h with
variable length data as A_UINT8 data[0]. KW tool perceives this
as a single uint8 and throws zero sized array when we try to access buffer
following data.
A uint8 pointer is assigned to data for this purpose in order to fake
the tool and resolve the issue.
Change-Id: I998f80c84554bc5bf4d0b2df1dae85352d72cb21
CRs-Fixed: 1106787
diff --git a/wmi_unified_non_tlv.c b/wmi_unified_non_tlv.c
index 4770150..93bdcf7 100644
--- a/wmi_unified_non_tlv.c
+++ b/wmi_unified_non_tlv.c
@@ -7476,11 +7476,13 @@
void *evt_buf, uint32_t index,
wmi_host_peer_extd_stats *peer_extd_stats)
{
+ uint8_t *pdata = ((wmi_stats_event *)evt_buf)->data;
+
if (WMI_REQUEST_PEER_EXTD_STAT &
((wmi_stats_event *)evt_buf)->stats_id) {
if (index < ((wmi_stats_event *)evt_buf)->num_peer_stats) {
wmi_peer_extd_stats *ev = (wmi_peer_extd_stats *)
- ((((wmi_stats_event *)evt_buf)->data) +
+ ((pdata) +
((((wmi_stats_event *)evt_buf)->num_pdev_stats) *
sizeof(wmi_pdev_stats)) +
((((wmi_stats_event *)evt_buf)->num_pdev_ext_stats) *
@@ -7511,13 +7513,15 @@
void *evt_buf, uint32_t index,
wmi_host_vdev_extd_stats *vdev_extd_stats)
{
+ uint8_t *pdata = ((wmi_stats_event *)evt_buf)->data;
+
if (WMI_REQUEST_PEER_EXTD_STAT &
((wmi_stats_event *)evt_buf)->stats_id) {
if (index < ((wmi_stats_event *)evt_buf)->num_vdev_stats) {
wmi_vdev_extd_stats *ev = (wmi_vdev_extd_stats *)
- ((((wmi_stats_event *)evt_buf)->data) +
+ ((pdata) +
((((wmi_stats_event *)evt_buf)->num_pdev_stats) *
sizeof(wmi_pdev_stats)) +
((((wmi_stats_event *)evt_buf)->num_pdev_ext_stats) *