mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-06 16:40:47 +00:00
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:
parent
c38df501ce
commit
6adf554abd
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue