From nobody Tue Dec 31 12:36:40 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 4YMssh3lMBz5jNsk; Tue, 31 Dec 2024 12:36:40 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YMssh2r7lz4gCc; Tue, 31 Dec 2024 12:36:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735648600; 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=8aOY6MCza72Up3Ao/PQnR1MLSCvPXKEVtZ6a0v32VGk=; b=W4bAcgoaXjeFH6muilPsogyFdlrQkzadSKXah1lEK8VBDK2ApZbzY1Y0s+lzJK7vfaYbJr BhPpzmvQNGL+eQF0jvKsjwVYpp1eDXmFe39rmuacsYk+T2PxPwe1tQkjpywWZ+xZFqyuvZ yKfSH7HRlMxOxYjAE5/RPwoBfqRv19A0ChvcZPlwB2aB1nVoNrqlaAfoPSNTbBKMXKJgKf ZqQlQNBunkFX1JABHx4s/6yMXuVp2kQju6CFPo4E1xiTGe9yBjW/jfmaEOWoE5qOcGY+mX wnqAzr7hsZH66XOSDHYuyvRDD72b6eUTS7X0xByNMWqnDJbgePZgmlJZNSXBlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735648600; 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=8aOY6MCza72Up3Ao/PQnR1MLSCvPXKEVtZ6a0v32VGk=; b=yETofra56y94BsXoKnc9yZo01nTmlMrF2ZxJ5EFLbNvHYCmamFZ14CqQRNJAz3N8AR/Isw eRADY4Y2mFf6fiPeo/JF6nxCG7AMU4KsaNgVfNJri7bDxvtr+b5zM6jAiFKffaTAWvKlrF 7Mw9+QlNig22W7tmJQ2q7DhCF6QG4+AboqofB6wrwZz34jron84v1V9Eg39MuY6qIuYIIi DSwr8KOAWmEjdFjtDkviwGDOVzZqn+4c/gxomLf/2aLDidWPN9weTYDVDDuyN3pY2KZxKI seEC7rIIstXZDC0iIQJYfVD49ax4A0gQreU4OVb1cHY8uFRK3bhPBhZXyP+paw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1735648600; a=rsa-sha256; cv=none; b=n90QIZWUi9vnj1AmELZHFjTgIPX5X4ubT9AYTbKDGgiqrXdlSVknukcxT9H+Vmty9PksP0 GBsFOtjXwsgfEK7PEr5fPsEjptaFzdJ3AbW6S9O3gRzOwsOIHh4uMaX8EqlsxCZxrSNVto nXSYTRJN/vil0wMgNswJKGbDFEjvdPKEvmD23hX2Ue2NW8ksTEq8ZilTbUWqquNO9LIZcv dVVlZ9wosIgPb32p3dRG+cRCTaQwwkTC3CeQouto0ogqFnDLxB++ApWz0bX+CTJNCUVmwh mi7biFwmPwqteeZC25Qz1ag+rEhmmoBPZhDuq7C2FJbgLHk0FI2+UPhp1+0+Mw== 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 4YMssh2PR1zg7c; Tue, 31 Dec 2024 12:36:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BVCaeSC093462; Tue, 31 Dec 2024 12:36:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BVCae9Q093459; Tue, 31 Dec 2024 12:36:40 GMT (envelope-from git) Date: Tue, 31 Dec 2024 12:36:40 GMT Message-Id: <202412311236.4BVCae9Q093459@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Osipov Subject: git: 7700d456bff4 - stable/14 - linprocfs: Properly reset error variable for mtab generation 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: michaelo X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7700d456bff49383e2e6e8994fd27661757395cf Auto-Submitted: auto-generated The branch stable/14 has been updated by michaelo: URL: https://cgit.FreeBSD.org/src/commit/?id=7700d456bff49383e2e6e8994fd27661757395cf commit 7700d456bff49383e2e6e8994fd27661757395cf Author: Michael Osipov AuthorDate: 2024-12-02 13:25:45 +0000 Commit: Michael Osipov CommitDate: 2024-12-31 12:36:18 +0000 linprocfs: Properly reset error variable for mtab generation Both functions linprocfs_domtab() and linprocfs_doprocmountinfo() are logically identical, but the former fails with ECANCELED because error is not reset after the for loop. Reviewed by: jrm, fluffy MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D47865 (cherry picked from commit 58c7db14cd71c41f59d80d26d921782c0c27d523) --- sys/compat/linprocfs/linprocfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index 5c60d4d8e713..9e69c92dc014 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -539,9 +539,7 @@ linprocfs_domtab(PFS_FILL_ARGS) error = kern_getfsstat(td, &buf, SIZE_T_MAX, &count, UIO_SYSSPACE, MNT_WAIT); if (error != 0) { - free(buf, M_TEMP); - free(flep, M_TEMP); - return (error); + goto out; } for (sp = buf; count > 0; sp++, count--) { @@ -561,6 +559,8 @@ linprocfs_domtab(PFS_FILL_ARGS) sbuf_printf(sb, " 0 0\n"); } + error = 0; +out: free(buf, M_TEMP); free(flep, M_TEMP); return (error);