From a5541a90110a446d8528082c11f5e403350e46fa 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 9f6f838a2..7def23198 100644 --- a/devicemodel/hw/pci/passthrough.c +++ b/devicemodel/hw/pci/passthrough.c @@ -177,7 +177,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;