Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Jul 2023 16:17:16 GMT
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 30f0328a322e - main - vmm: don't return random error from vcpu_lock_all() if vcpu is empty
Message-ID:  <202307121617.36CGHGaf010912@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by glebius:

URL: https://cgit.FreeBSD.org/src/commit/?id=30f0328a322eb17e7b6bf31a8d587a071e9421ed

commit 30f0328a322eb17e7b6bf31a8d587a071e9421ed
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2023-07-12 16:16:40 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2023-07-12 16:16:40 +0000

    vmm: don't return random error from vcpu_lock_all() if vcpu is empty
    
    When vcpu array is empty, function would return random value from
    stack.  What I observed was -1.
    
    Reviewed by:            corvink, markj
    Differential Revision:  https://reviews.freebsd.org/D40980
---
 sys/amd64/vmm/vmm_dev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/amd64/vmm/vmm_dev.c b/sys/amd64/vmm/vmm_dev.c
index f9fcb32d8e28..74c751d7f116 100644
--- a/sys/amd64/vmm/vmm_dev.c
+++ b/sys/amd64/vmm/vmm_dev.c
@@ -187,6 +187,7 @@ vcpu_lock_all(struct vmmdev_softc *sc)
 	int error;
 	uint16_t i, j, maxcpus;
 
+	error = 0;
 	vm_slock_vcpus(sc->vm);
 	maxcpus = vm_get_maxcpus(sc->vm);
 	for (i = 0; i < maxcpus; i++) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202307121617.36CGHGaf010912>