From nobody Tue Jan 02 00:37:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T3v7z6RCGz55yhF; Tue, 2 Jan 2024 00:37:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T3v7z2qQKz3J6w; Tue, 2 Jan 2024 00:37:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704155855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tk3QMb+/Gn+0yLvQWDGI7e01wKQjQ9E41FgJBXa8LCY=; b=Z+bANG4ebUCbS8xQB3TwgZGkfFrcjjrZTZ9GaWjJ9fj0EXRZx2/eokCOHZJ/kcMvijIhQV 5odslxZuBvfDlVkRl45hn80gxYeQM8RKdyX4nACo4cKX6odAQw+Ye01zD76yD4BkaHlF3+ fIex9KuFSoKuogmQ9ibvelJAl8nT3Al5PLK9KGD5rq2qCCvoYm7ef7CyVYT5FIwiIWdbce KF1QzoZB9QZLmQhVSFmIRQ6jU45aStvftWm5Hbxdie8XgU3ieykba+keW02TDOHzZy5Sv/ X3wy42r7BTnULPzDkshWexNiFkJg4CYgW3eoP2OGtKjc5J3MKp5rh7MdhGOqAw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704155855; a=rsa-sha256; cv=none; b=B4lam9U3VOYVocumXdMY2GSNP/xG2O/KPeM6l5QFiMSA2ul0BbQ86LjdXtj/rgYiFj35ve Z9PwicGrfJrkI9ooPW6vSHcigiZ48MCtDwOUX518koKnUg6jVomYDzvpFrddmPTB9Wh7fv oYfWuTdTCs/QsY1LB+9kHJUTtsuN0mrQF2/YxV+V5wZ5vk0F/4gJti3BkyH/9BIE53Mh+Q QLwpR7HzWfmv0jbm4qZP4OZCe8+HMO4D7m4x4dRcUiDDyfuGEy5q8KRMIe1eJ14hk93uTQ 9H+jb8WrKFNx0rraNYDKe2U3TBOD+O370vp4iQvGMbgJubv40e6zC1nFM3q50g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704155855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tk3QMb+/Gn+0yLvQWDGI7e01wKQjQ9E41FgJBXa8LCY=; b=T46QROK66WLaSnm6KYhzaR589PKKUb8idnxVr0CzoYxIMz/0iOWMzsulUUVHQMj+XVnuxY esFzQhkHzsSekKXbi/b1Um3C0c0lAJuj3RRe0vldgzeCKu26QkxwS7f3qczFzBVkR0fxJq /vvChz242vr8X7hB6dIYyRTpv0qpdG64Fh2V99RySzDwIlw9l50LJf3hNbbgOWxnaK6F5j ON1C4i3JwcgWciTzpPUm7JfRo2jlW9medUtxlxvUSjNWkatBqpfHFXcF4Pqg0UcOO1wG/2 +XPdS5TYFQM231UeowOyRkqwkTEzbMbDY1e54IN8yPFCS8O4R8ftJ8HcHdzXrQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4T3v7z1nfvzfbG; Tue, 2 Jan 2024 00:37:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4020bZ56085941; Tue, 2 Jan 2024 00:37:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4020bZaf085938; Tue, 2 Jan 2024 00:37:35 GMT (envelope-from git) Date: Tue, 2 Jan 2024 00:37:35 GMT Message-Id: <202401020037.4020bZaf085938@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: fecd8e111a0b - stable/14 - compat_freebsd4: Fix handling of errors from subyte() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fecd8e111a0bbd4eb4224b2b4821d3097ea9ea00 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fecd8e111a0bbd4eb4224b2b4821d3097ea9ea00 commit fecd8e111a0bbd4eb4224b2b4821d3097ea9ea00 Author: Mark Johnston AuthorDate: 2023-12-26 01:43:38 +0000 Commit: Mark Johnston CommitDate: 2024-01-02 00:30:00 +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 398ac18c9422..66d99edb7da1 100644 --- a/sys/kern/kern_xxx.c +++ b/sys/kern/kern_xxx.c @@ -367,13 +367,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;