From 3148cb077a93af006648440c945dc78f6fd9fa8c Mon Sep 17 00:00:00 2001 From: Sathish Kumar Date: Tue, 3 Jan 2017 11:14:16 +0530 Subject: [PATCH] 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 --- wmi/src/wmi_unified_non_tlv.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wmi/src/wmi_unified_non_tlv.c b/wmi/src/wmi_unified_non_tlv.c index 4770150e0322..93bdcf73f5af 100644 --- a/wmi/src/wmi_unified_non_tlv.c +++ b/wmi/src/wmi_unified_non_tlv.c @@ -7476,11 +7476,13 @@ static QDF_STATUS extract_peer_extd_stats_non_tlv(wmi_unified_t wmi_handle, 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 @@ static QDF_STATUS extract_vdev_extd_stats_non_tlv(wmi_unified_t wmi_handle, 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) *