Browse Source

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
Sathish Kumar 8 years ago
parent
commit
3148cb077a
1 changed files with 6 additions and 2 deletions
  1. 6 2
      wmi/src/wmi_unified_non_tlv.c

+ 6 - 2
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) *