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
This commit is contained in:
Robert Watson 2002-02-20 00:11:57 +00:00
parent d2760948fe
commit ec20f901a2

View File

@ -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);
}
}