From 1c61872ef743dc12673f7210aabb950a7239507a Mon Sep 17 00:00:00 2001 From: Fei Li Date: Thu, 9 Sep 2021 10:53:48 +0800 Subject: [PATCH] dm: pci: minor bug fix about uninitialized local variable 'error' might be used uninitialized in cfginitbar. So initialize it to zero at the beginning. Tracked-On: #6284 Signed-off-by: Fei Li --- devicemodel/hw/pci/passthrough.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devicemodel/hw/pci/passthrough.c b/devicemodel/hw/pci/passthrough.c index 1fbe6a26f..538ac4dc3 100644 --- a/devicemodel/hw/pci/passthrough.c +++ b/devicemodel/hw/pci/passthrough.c @@ -179,7 +179,7 @@ static inline int ptdev_msix_pba_bar(struct passthru_dev *ptdev) static int cfginitbar(struct vmctx *ctx, struct passthru_dev *ptdev) { - int i, error; + int i, error = 0; struct pci_vdev *dev; struct pci_bar_io bar; enum pcibar_type bartype;