git: 736f172567be - stable/13 - compat_freebsd4: Fix handling of errors from subyte()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 02 Jan 2024 01:13:16 UTC
The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=736f172567be5f984f1202b388a798b8345d06ad commit 736f172567be5f984f1202b388a798b8345d06ad Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2023-12-26 01:43:38 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2024-01-02 01:12:45 +0000 compat_freebsd4: Fix handling of errors from subyte() Upon failure, subyte() returns -1, not an errno value. MFC after: 1 week (cherry picked from commit c38df501ce2ed7da128448f815ec627c39fd3bad) --- sys/kern/kern_xxx.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/kern/kern_xxx.c b/sys/kern/kern_xxx.c index 8674dbf61361..ae88fc90eb7c 100644 --- a/sys/kern/kern_xxx.c +++ b/sys/kern/kern_xxx.c @@ -374,13 +374,11 @@ freebsd4_uname(struct thread *td, struct freebsd4_uname_args *uap) for(s = version; *s && *s != '#'; s++); for(us = uap->name->version; *s && *s != ':'; s++) { - error = subyte( us++, *s); - if (error) - return (error); + if (subyte(us++, *s) != 0) + return (EFAULT); } - error = subyte( us++, 0); - if (error) - return (error); + if (subyte(us++, 0) != 0) + return (EFAULT); name[0] = CTL_HW; name[1] = HW_MACHINE;