diff options
author | arr <arr@FreeBSD.org> | 2002-03-26 18:07:10 +0000 |
---|---|---|
committer | arr <arr@FreeBSD.org> | 2002-03-26 18:07:10 +0000 |
commit | da9c75ac6890cea557f4372a0f7457a593b3aff8 (patch) | |
tree | 11d49ab8260afa165682600b0cda17d2ca7d0b83 | |
parent | 6d47f88e6ce653e952dd4e131070290f7c699d7f (diff) | |
download | FreeBSD-src-da9c75ac6890cea557f4372a0f7457a593b3aff8.zip FreeBSD-src-da9c75ac6890cea557f4372a0f7457a593b3aff8.tar.gz |
- 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
-rw-r--r-- | sys/kern/vfs_extattr.c | 11 | ||||
-rw-r--r-- | 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 bb29491..3972b15 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 bb29491..3972b15 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 */ |