aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorvin Köhne <CorvinK@beckhoff.com>2022-04-01 08:19:53 +0000
committerEmmanuel Vadot <manu@FreeBSD.org>2022-05-16 15:24:33 +0000
commit8c119b3b711dc256b97c258e6ca23547a0fffc99 (patch)
treef73df4a8d8ba1a7a55bff05325ba7a76955efe0e
parent1b3141c63046b76ead1e26265d7301364e4c541c (diff)
downloadsrc-8c119b3b711dc256b97c258e6ca23547a0fffc99.tar.gz
src-8c119b3b711dc256b97c258e6ca23547a0fffc99.zip
bhyve: avoid uninitialized variable
Reviewed by: markj Signed-off-by: Corvin Köhne <c.koehne@beckhoff.com> Reported-by: Andy Fiddaman <andy@omniosce.org> Differential Revision: https://reviews.freebsd.org/D34688 (cherry picked from commit 8ac8adda8dbaceebd296e4fd7df36b7a8db7f6d3)
-rw-r--r--usr.sbin/bhyve/pci_emul.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.sbin/bhyve/pci_emul.c b/usr.sbin/bhyve/pci_emul.c
index 8cadc0580311..b58a51bce78b 100644
--- a/usr.sbin/bhyve/pci_emul.c
+++ b/usr.sbin/bhyve/pci_emul.c
@@ -825,6 +825,8 @@ pci_emul_assign_bar(struct pci_devinst *const pdi, const int idx,
error = pci_emul_alloc_resource(baseptr, limit, size, &addr);
if (error != 0)
return (error);
+ } else {
+ addr = 0;
}
pdi->pi_bar[idx].type = type;