Browse Source

qca-wifi: Copy bit map from TLV to host data structure

On receiving multi-vdev restart response from FW, the bit map size
indicates the size in words. Due to which when extracting the info
into host data structure only 2bytes are copied as against 2words.

Fix by extracting the complete contents of the TLV.

Change-Id: Ibc5de7c2b1d74e0fbcd2317e57955915f2dc0c3d
CRs-Fixed: 2619141
Santosh Anbu 5 years ago
parent
commit
318d608c35
1 changed files with 3 additions and 2 deletions
  1. 3 2
      wmi/src/wmi_unified_ap_tlv.c

+ 3 - 2
wmi/src/wmi_unified_ap_tlv.c

@@ -2540,14 +2540,15 @@ static QDF_STATUS extract_multi_vdev_restart_resp_event_tlv(
 	if (!param_buf->num_vdev_ids_bitmap)
 		return QDF_STATUS_E_FAILURE;
 
-	if (param_buf->num_vdev_ids_bitmap > sizeof(param->vdev_id_bmap)) {
+	if ((param_buf->num_vdev_ids_bitmap * sizeof(uint32_t)) >
+			sizeof(param->vdev_id_bmap)) {
 		WMI_LOGE("vdevId bitmap overflow size:%d",
 			 param_buf->num_vdev_ids_bitmap);
 		return QDF_STATUS_E_FAILURE;
 	}
 
 	qdf_mem_copy(param->vdev_id_bmap, param_buf->vdev_ids_bitmap,
-		     param_buf->num_vdev_ids_bitmap);
+		     param_buf->num_vdev_ids_bitmap * sizeof(uint32_t));
 
 	WMI_LOGD("vdev_id_bmap :0x%x%x", param->vdev_id_bmap[1],
 		 param->vdev_id_bmap[0]);