The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7c89253bda3ea32a9c44104c2d09f86b70195cad
commit 7c89253bda3ea32a9c44104c2d09f86b70195cad Author: John Baldwin <j...@freebsd.org> AuthorDate: 2024-12-13 16:52:31 +0000 Commit: John Baldwin <j...@freebsd.org> CommitDate: 2024-12-13 16:52:31 +0000 vmm: Initialize error in vmmdev_rw CID: 1568045 Reported by: Coverity Scan Reviewed by: markj Fixes: 4008758105a6 vmm: Validate credentials when opening a vmmdev Differential Revision: https://reviews.freebsd.org/D48073 --- sys/dev/vmm/vmm_dev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/vmm/vmm_dev.c b/sys/dev/vmm/vmm_dev.c index 4bea4360a51c..4ab99f92f72a 100644 --- a/sys/dev/vmm/vmm_dev.c +++ b/sys/dev/vmm/vmm_dev.c @@ -195,6 +195,7 @@ vmmdev_rw(struct cdev *cdev, struct uio *uio, int flags) */ vm_slock_memsegs(sc->vm); + error = 0; prot = (uio->uio_rw == UIO_WRITE ? VM_PROT_WRITE : VM_PROT_READ); maxaddr = vmm_sysmem_maxaddr(sc->vm); while (uio->uio_resid > 0 && error == 0) {