mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 09:10:28 +00:00
freebsd32: Fix error handling for suword32() calls
suword32() returns -1 upon an error, not an errno value. MFC after: 1 week
This commit is contained in:
parent
3d36053ca6
commit
bd1654ce92
|
@ -117,9 +117,10 @@ freebsd32_cap_ioctls_get(struct thread *td,
|
|||
cmds = fdep->fde_ioctls;
|
||||
if (cmds32 != NULL && cmds != NULL) {
|
||||
for (i = 0; i < MIN(fdep->fde_nioctls, maxcmds); i++) {
|
||||
error = suword32(&cmds32[i], cmds[i]);
|
||||
if (error != 0)
|
||||
if (suword32(&cmds32[i], cmds[i]) != 0) {
|
||||
error = EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (fdep->fde_nioctls == -1)
|
||||
|
|
|
@ -2700,9 +2700,8 @@ freebsd32___sysctlbyname(struct thread *td,
|
|||
&oldlen, uap->new, uap->newlen, &rv, SCTL_MASK32, 1);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
if (uap->oldlenp != NULL)
|
||||
error = suword32(uap->oldlenp, rv);
|
||||
|
||||
if (uap->oldlenp != NULL && suword32(uap->oldlenp, rv) != 0)
|
||||
error = EFAULT;
|
||||
return (error);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue