vmm: Fix handling of errors from subyte()

subyte() returns -1 upon an error, not an errno value.

MFC after:	1 week
Fixes:	e17eca3276 ("vmm: Avoid embedding cpuset_t ioctl ABIs")
This commit is contained in:
Mark Johnston 2023-12-25 20:43:51 -05:00
parent c38df501ce
commit 6adf554abd

View File

@ -629,10 +629,12 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag,
p = (uint8_t *)vmrun->cpuset +
sizeof(cpuset_t);
while (error == 0 &&
p < (uint8_t *)vmrun->cpuset +
while (p < (uint8_t *)vmrun->cpuset +
vmrun->cpusetsize) {
error = subyte(p++, 0);
if (subyte(p++, 0) != 0) {
error = EFAULT;
break;
}
}
}
}