From dcce8874ebf7a8c8f8efefa512e963aa1ce8089f Mon Sep 17 00:00:00 2001 From: "Andrew R. Reiter" Date: Tue, 26 Mar 2002 18:07:10 +0000 Subject: [PATCH] - Fixup a few style nits: - return error -> return (error); - move a declaration to the top of the function. - become bug for bug compatible with if (error) lines. Submitted by: bde --- sys/kern/vfs_extattr.c | 11 +++++------ sys/kern/vfs_syscalls.c | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index bb2949129cf4..3972b1520aa2 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -724,6 +724,7 @@ vfs_mount(td, fstype, fspath, fsflags, fsdata) int error, flag = 0, flag2 = 0; struct vattr va; struct nameidata nd; + linker_file_t lf; /* * Be ultra-paranoid about making sure the type and fspath @@ -836,25 +837,23 @@ vfs_mount(td, fstype, fspath, fsflags, fsdata) if (!strcmp(vfsp->vfc_name, fstype)) break; if (vfsp == NULL) { - linker_file_t lf; - /* Only load modules for root (very important!) */ error = suser_td(td); if (error) { vput(vp); - return error; + return (error); } error = securelevel_gt(td->td_ucred, 0); - if (error != 0) { + if (error) { vput(vp); - return (EPERM); + return (error); } error = linker_load_file(fstype, &lf); if (error || lf == NULL) { vput(vp); if (lf == NULL) error = ENODEV; - return error; + return (error); } lf->userrefs++; /* lookup again, see if the VFS was loaded */ diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index bb2949129cf4..3972b1520aa2 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -724,6 +724,7 @@ vfs_mount(td, fstype, fspath, fsflags, fsdata) int error, flag = 0, flag2 = 0; struct vattr va; struct nameidata nd; + linker_file_t lf; /* * Be ultra-paranoid about making sure the type and fspath @@ -836,25 +837,23 @@ vfs_mount(td, fstype, fspath, fsflags, fsdata) if (!strcmp(vfsp->vfc_name, fstype)) break; if (vfsp == NULL) { - linker_file_t lf; - /* Only load modules for root (very important!) */ error = suser_td(td); if (error) { vput(vp); - return error; + return (error); } error = securelevel_gt(td->td_ucred, 0); - if (error != 0) { + if (error) { vput(vp); - return (EPERM); + return (error); } error = linker_load_file(fstype, &lf); if (error || lf == NULL) { vput(vp); if (lf == NULL) error = ENODEV; - return error; + return (error); } lf->userrefs++; /* lookup again, see if the VFS was loaded */