vmm: Initialize error in vmmdev_rw

CID:		1568045
Reported by:	Coverity Scan
Reviewed by:	markj
Fixes:		4008758105 vmm: Validate credentials when opening a vmmdev
Differential Revision:	https://reviews.freebsd.org/D48073
This commit is contained in:
John Baldwin
2024-12-13 11:52:31 -05:00
parent e2fc29e539
commit 7c89253bda
+1
View File
@@ -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) {