diff options
author | Michael Osipov <michaelo@FreeBSD.org> | 2024-12-02 13:25:45 +0000 |
---|---|---|
committer | Michael Osipov <michaelo@FreeBSD.org> | 2024-12-31 12:37:39 +0000 |
commit | 3f00a0678b9de3657d859e590adb3e646aebb2ae (patch) | |
tree | 48ea4c7b90830fd988560f269a406a2eba69423d /sys/compat/linprocfs/linprocfs.c | |
parent | 420d4927b31170d4b04462e9265519af9e8d764c (diff) |
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)
Diffstat (limited to 'sys/compat/linprocfs/linprocfs.c')
-rw-r--r-- | sys/compat/linprocfs/linprocfs.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index f8bbb0d8fbfc..0a471f684680 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -543,9 +543,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--) { @@ -565,6 +563,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); |