From ec20f901a2dd547c443edf382eb36b9dc551acf2 Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Wed, 20 Feb 2002 00:11:57 +0000 Subject: [PATCH] More cleanups relating to vm object allocation failure: make sure we call VOP_CLOSE() with vp unlocked; clean up the return path a little, in as much as our namei/vnode operation return paths can be cleared up. For a return case that was apparently never taken, this sure is ugly. Reviewed by: jeffr --- sys/kern/vfs_vnops.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 99707d2b0760..aba87d4ca936 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -199,8 +199,12 @@ vn_open_cred(ndp, flagp, cmode, cred) */ if (vn_canvmio(vp) == TRUE) { if ((error = vfs_object_create(vp, td, cred)) != 0) { + VOP_UNLOCK(vp, 0, td); VOP_CLOSE(vp, fmode, cred, td); - goto bad; + NDFREE(ndp, NDF_ONLY_PNBUF); + vrele(vp); + *flagp = fmode; + return (error); } }