diff options
| author | Michael Osipov <michaelo@FreeBSD.org> | 2024-12-02 13:25:45 +0000 |
|---|---|---|
| committer | Michael Osipov <michaelo@FreeBSD.org> | 2024-12-17 08:59:38 +0000 |
| commit | 58c7db14cd71c41f59d80d26d921782c0c27d523 (patch) | |
| tree | 599362e7fd5b35183445f6d11a710ffd25093f5c | |
| parent | da2c88dfcf4f425e6e0a58d6df3a7c8e88d8df92 (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
| -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 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); |
