Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Sep 2021 19:06:06 GMT
From:      Ka Ho Ng <khng@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 0eb56e7496f6 - stable/12 - vmm: Fix wrong assert in ivhd_dev_add_entry
Message-ID:  <202109031906.183J66pV050746@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by khng:

URL: https://cgit.FreeBSD.org/src/commit/?id=0eb56e7496f6d8056990d07500be015fcb09dd54

commit 0eb56e7496f6d8056990d07500be015fcb09dd54
Author:     Ka Ho Ng <khng@FreeBSD.org>
AuthorDate: 2021-08-12 07:54:40 +0000
Commit:     Ka Ho Ng <khng@FreeBSD.org>
CommitDate: 2021-09-03 18:46:41 +0000

    vmm: Fix wrong assert in ivhd_dev_add_entry
    
    The correct condition is to check the number of ivhd entries fit into
    the array.
    
    Reported by:    bz
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D31514
    
    (cherry picked from commit 179bc5729dd72e0f4252c0dce72454c76782f935)
---
 sys/amd64/vmm/amd/ivrs_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/amd64/vmm/amd/ivrs_drv.c b/sys/amd64/vmm/amd/ivrs_drv.c
index 1455e314b692..86a9f558e32a 100644
--- a/sys/amd64/vmm/amd/ivrs_drv.c
+++ b/sys/amd64/vmm/amd/ivrs_drv.c
@@ -185,7 +185,7 @@ ivhd_dev_add_entry(struct amdvi_softc *softc, uint32_t start_id,
 {
 	struct ivhd_dev_cfg *dev_cfg;
 
-	KASSERT(softc->dev_cfg_cap <= softc->dev_cfg_cnt,
+	KASSERT(softc->dev_cfg_cap >= softc->dev_cfg_cnt,
 	    ("Impossible case: number of dev_cfg exceeding capacity"));
 	if (softc->dev_cfg_cap == softc->dev_cfg_cnt) {
 		if (softc->dev_cfg_cap == 0)



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