mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
vfs: fix up NDFREE_PNBUF usage in vfs_mountroot_shuffle
Noted by: karels
This commit is contained in:
parent
4d9b2ed34b
commit
176d83eafc
1 changed files with 2 additions and 3 deletions
|
|
@ -352,13 +352,13 @@ vfs_mountroot_shuffle(struct thread *td, struct mount *mpdevfs)
|
|||
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, fspath);
|
||||
error = namei(&nd);
|
||||
if (error) {
|
||||
NDFREE_PNBUF(&nd);
|
||||
fspath = "/mnt";
|
||||
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE,
|
||||
fspath);
|
||||
error = namei(&nd);
|
||||
}
|
||||
if (!error) {
|
||||
NDFREE_PNBUF(&nd);
|
||||
vp = nd.ni_vp;
|
||||
error = (vp->v_type == VDIR) ? 0 : ENOTDIR;
|
||||
if (!error)
|
||||
|
|
@ -376,7 +376,6 @@ vfs_mountroot_shuffle(struct thread *td, struct mount *mpdevfs)
|
|||
} else
|
||||
vput(vp);
|
||||
}
|
||||
NDFREE_PNBUF(&nd);
|
||||
|
||||
if (error)
|
||||
printf("mountroot: unable to remount previous root "
|
||||
|
|
@ -387,6 +386,7 @@ vfs_mountroot_shuffle(struct thread *td, struct mount *mpdevfs)
|
|||
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, "/dev");
|
||||
error = namei(&nd);
|
||||
if (!error) {
|
||||
NDFREE_PNBUF(&nd);
|
||||
vp = nd.ni_vp;
|
||||
error = (vp->v_type == VDIR) ? 0 : ENOTDIR;
|
||||
if (!error)
|
||||
|
|
@ -413,7 +413,6 @@ vfs_mountroot_shuffle(struct thread *td, struct mount *mpdevfs)
|
|||
if (error)
|
||||
printf("mountroot: unable to remount devfs under /dev "
|
||||
"(error %d)\n", error);
|
||||
NDFREE_PNBUF(&nd);
|
||||
|
||||
if (mporoot == mpdevfs) {
|
||||
vfs_unbusy(mpdevfs);
|
||||
|
|
|
|||
Loading…
Reference in a new issue