summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2006-01-27 11:27:55 +0000
committerpjd <pjd@FreeBSD.org>2006-01-27 11:27:55 +0000
commit4b80a65bfea74b0e795656c25215544a0193413d (patch)
tree5430cb104862574f0cd0f2ed1557a5073c3c2de2
parent26c98c76f9c8ad29f3fdd594c1ed4502d6a43159 (diff)
downloadFreeBSD-src-4b80a65bfea74b0e795656c25215544a0193413d.zip
FreeBSD-src-4b80a65bfea74b0e795656c25215544a0193413d.tar.gz
Call NDFREE() only when vn_open() succeeded.
MFC after: 3 days
-rw-r--r--sys/dev/md/md.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c
index 82e97f0..bc961b8 100644
--- a/sys/dev/md/md.c
+++ b/sys/dev/md/md.c
@@ -868,9 +868,9 @@ mdcreate_vnode(struct md_s *sc, struct md_ioctl *mdio, struct thread *td)
flags &= ~FWRITE;
NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, sc->file, td);
error = vn_open(&nd, &flags, 0, -1);
- NDFREE(&nd, NDF_ONLY_PNBUF);
if (error != 0)
return (error);
+ NDFREE(&nd, NDF_ONLY_PNBUF);
if (nd.ni_vp->v_type != VREG ||
(error = VOP_GETATTR(nd.ni_vp, &vattr, td->td_ucred, td))) {
VOP_UNLOCK(nd.ni_vp, 0, td);
OpenPOWER on IntegriCloud