mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04: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")
(cherry picked from commit 6adf554abd1c848d2c9ab7ea8a7fb7dd20a0c186)
This commit is contained in:
parent
fecd8e111a
commit
266eefe7f4
1 changed files with 5 additions and 3 deletions
|
|
@ -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