summaryrefslogtreecommitdiffstats
path: root/sys/compat/svr4
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2009-05-20 18:25:16 +0000
committerjhb <jhb@FreeBSD.org>2009-05-20 18:25:16 +0000
commitbc9abffcd5551c3a4797d213bff7b88c21103c7d (patch)
tree067808d2d638996296cd93823b22142a0ee9fc46 /sys/compat/svr4
parentafb99fc6202799ec29dbabf2401e3a4f351bd24c (diff)
downloadFreeBSD-src-bc9abffcd5551c3a4797d213bff7b88c21103c7d.zip
FreeBSD-src-bc9abffcd5551c3a4797d213bff7b88c21103c7d.tar.gz
Put the vnode returned from namei() immediately after namei() returns in
svr4_sys_resolvepath().
Diffstat (limited to 'sys/compat/svr4')
-rw-r--r--sys/compat/svr4/svr4_misc.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c
index ad56a11..dd93c36 100644
--- a/sys/compat/svr4/svr4_misc.c
+++ b/sys/compat/svr4/svr4_misc.c
@@ -1611,14 +1611,14 @@ svr4_sys_resolvepath(td, uap)
struct nameidata nd;
int error, *retval = td->td_retval;
unsigned int ncopy;
- int vfslocked;
NDINIT(&nd, LOOKUP, NOFOLLOW | SAVENAME | MPSAFE, UIO_USERSPACE,
uap->path, td);
if ((error = namei(&nd)) != 0)
- return error;
- vfslocked = NDHASGIANT(&nd);
+ return (error);
+ NDFREE(&nd, NDF_NO_FREE_PNBUF);
+ VFS_UNLOCK_GIANT(NDHASGIANT(&nd));
ncopy = min(uap->bufsiz, strlen(nd.ni_cnd.cn_pnbuf) + 1);
if ((error = copyout(nd.ni_cnd.cn_pnbuf, uap->buf, ncopy)) != 0)
@@ -1627,7 +1627,5 @@ svr4_sys_resolvepath(td, uap)
*retval = ncopy;
bad:
NDFREE(&nd, NDF_ONLY_PNBUF);
- vput(nd.ni_vp);
- VFS_UNLOCK_GIANT(vfslocked);
return error;
}
OpenPOWER on IntegriCloud