git: 58c7db14cd71 - main - linprocfs: Properly reset error variable for mtab generation
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 17 Dec 2024 09:00:27 UTC
The branch main has been updated by michaelo: URL: https://cgit.FreeBSD.org/src/commit/?id=58c7db14cd71c41f59d80d26d921782c0c27d523 commit 58c7db14cd71c41f59d80d26d921782c0c27d523 Author: Michael Osipov <michaelo@FreeBSD.org> AuthorDate: 2024-12-02 13:25:45 +0000 Commit: Michael Osipov <michaelo@FreeBSD.org> CommitDate: 2024-12-17 08:59:38 +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 --- 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 c5b6ec9b32c1..587c7412d80a 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -537,9 +537,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--) { @@ -559,6 +557,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);