Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 May 2024 20:00:33 GMT
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: f7d45c5443ed - main - bhyve: avoid side effect in assertion
Message-ID:  <202405172000.44HK0Xw3049841@gitrepo.freebsd.org>

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

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

commit f7d45c5443edc99857fdda19c68301b5ec4a8971
Author:     Pierre Pronchery <pierre@freebsdfoundation.org>
AuthorDate: 2024-05-17 07:31:32 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2024-05-17 19:45:18 +0000

    bhyve: avoid side effect in assertion
    
    An assert() was setting the error variable instead of checking it.
    
    Reported by:    Coverity Scan
    CID:            1521431
    Reviewed by:    jhb
    Sponsored by:   The FreeBSD Foundation
    Pull Request:   https://github.com/freebsd/freebsd-src/pull/1244
---
 usr.sbin/bhyve/tpm_ppi_qemu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.sbin/bhyve/tpm_ppi_qemu.c b/usr.sbin/bhyve/tpm_ppi_qemu.c
index ad66ecb09683..239d39184589 100644
--- a/usr.sbin/bhyve/tpm_ppi_qemu.c
+++ b/usr.sbin/bhyve/tpm_ppi_qemu.c
@@ -161,7 +161,7 @@ tpm_ppi_deinit(void *sc)
 	ppi = sc;
 
 	error = unregister_mem(&ppi_mmio);
-	assert(error = 0);
+	assert(error == 0);
 
 	free(ppi);
 }



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