From nobody Tue Dec 26 02:04:35 2023 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 4SzdPb5qZ7z55Kmd; Tue, 26 Dec 2023 02:04: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 4SzdPb4QNTz4Kr9; Tue, 26 Dec 2023 02:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703556275; 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=u68C4XAYJg0CJEg9xsBUt9XrlVfqqcc4JEzClcGkbew=; b=SLN52+CsdayNjQnHdqnUJxAifs68nTF4i1PSVfOTf1x31UVEWz8SMAn2DKKVwjyDYGPmiM jqoeJjUwyITPGF39X9IgRsfSPeLlzKcQlMhqVsQcgwJV5udT0Fx0e7ylTqrpX1f/9AWTJw HTEzKFW9U+o3PZWaPu+5VyQPfUSO4+uLZ26RUWJ4c24lS8Wb84s7/VVV0+G7vMCFIGSPvU 9ii9FF60gpLNqDeQTUNU2UpQjCp79/QIHZTMzO4BGq0vyFi0tZNzkEHsFBetb0avbnwHQn NYW6uprB9mQ2EQ7VRwPH1oe3JtA/y7ze9xO81yXsAXvdQdI0Tka/p0NITjcKpA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703556275; a=rsa-sha256; cv=none; b=Wv8UWOyL1KdMBmMT1zm/hjSErkIg1oYzqLhEj7SpJtassnfyspZjwByoQzfXCaTkPtj+hw +wlrqIzKwfjf0nvOpSIvwSENI2ZU4ut0UpkT6qwuIeyDQO+LaJetIHapLA7bt61XaYHRFq heFLLPwl3DPSBzvR45jrAY+Xh/Ml0OBGnJcTx4tdcHxBkk6Gs4zemCnIEALq9RM8xJkNSW 0awWp4SQnw4PdfayB6/4d4pIuOb35no4+GM0pPzwYfhH/ngZAokCPqI0W+W4zFTowwbTMu f1+Bp/DfsCHTEtjfbe/qAdKWOM6/g3Mxrt7H9JEgAEV7sGvcKzwgGApqoqqN1w== 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=1703556275; 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=u68C4XAYJg0CJEg9xsBUt9XrlVfqqcc4JEzClcGkbew=; b=n13GZXDVJV8gCLG1GakRyaaAMBQeVkRxgKomzcz0oIuzoKOnybbI/QqY46E7Qg0ia+ZBYJ nmh50A7EWxJ0PUwnzoqI+10ux+kiFiswKqTnHWuCO0ZCwgscLVry9u+qzcv1vHiPogXAoZ wgmp73aBdIXzX6bqkC/SWb3fUE542SnQ2dA+4WwxfgfA038fbHtSgqnrI5SyMvJ4zDTolD ZN7cDl6zNHfq+byFp3RS6iuSonMc2pNLZDNS0hdxnBu4rZUkP2VcJSUCIk5dpMQfXSXH6h jiMho2L5CmAuKBgKcesjsIHmOQQV62DDK0A+ztPjDs0niYZOG9Snq5cZWg9SbA== 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 4SzdPb3XG6zbPt; Tue, 26 Dec 2023 02:04: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 3BQ24ZSh003708; Tue, 26 Dec 2023 02:04:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BQ24ZpF003705; Tue, 26 Dec 2023 02:04:35 GMT (envelope-from git) Date: Tue, 26 Dec 2023 02:04:35 GMT Message-Id: <202312260204.3BQ24ZpF003705@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: c38df501ce2e - main - 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/main X-Git-Reftype: branch X-Git-Commit: c38df501ce2ed7da128448f815ec627c39fd3bad Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c38df501ce2ed7da128448f815ec627c39fd3bad commit c38df501ce2ed7da128448f815ec627c39fd3bad Author: Mark Johnston AuthorDate: 2023-12-26 01:43:38 +0000 Commit: Mark Johnston CommitDate: 2023-12-26 02:04:01 +0000 compat_freebsd4: Fix handling of errors from subyte() Upon failure, subyte() returns -1, not an errno value. MFC after: 1 week --- 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 e8331a5cdb1f..46155cf6a73e 100644 --- a/sys/kern/kern_xxx.c +++ b/sys/kern/kern_xxx.c @@ -364,13 +364,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;