diff options
author | pjd <pjd@FreeBSD.org> | 2006-01-27 11:27:55 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2006-01-27 11:27:55 +0000 |
commit | 4b80a65bfea74b0e795656c25215544a0193413d (patch) | |
tree | 5430cb104862574f0cd0f2ed1557a5073c3c2de2 | |
parent | 26c98c76f9c8ad29f3fdd594c1ed4502d6a43159 (diff) | |
download | FreeBSD-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.c | 2 |
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); |