From 10c407cc853120c4487dd747ff6bb034cfc1f185 Mon Sep 17 00:00:00 2001 From: Minggui Cao Date: Thu, 5 Dec 2019 15:22:03 +0800 Subject: [PATCH] HV: init local variable before it is used. it is better to init bdfs_from_drhds.pci_bdf_map_count before it is passed to other function to do: bdfs_from_drhds->pci_bdf_map_count++ Tracked-On: #3875 Signed-off-by: Minggui Cao Reviewed-by: Fei Li --- hypervisor/hw/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hypervisor/hw/pci.c b/hypervisor/hw/pci.c index 3238814ae..77a8dba64 100644 --- a/hypervisor/hw/pci.c +++ b/hypervisor/hw/pci.c @@ -440,7 +440,7 @@ static void pci_parse_iommu_devscopes(struct pci_bdf_set *const bdfs_from_drhds, void init_pci_pdev_list(void) { uint64_t buses_visited[BUSES_BITMAP_LEN] = {0UL}; - struct pci_bdf_set bdfs_from_drhds; + struct pci_bdf_set bdfs_from_drhds = {.pci_bdf_map_count = 0U}; uint32_t drhd_idx_pci_all = INVALID_DRHD_INDEX; uint16_t bus; bool was_visited = false;