summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authortmm <tmm@FreeBSD.org>2001-06-07 00:11:32 +0000
committertmm <tmm@FreeBSD.org>2001-06-07 00:11:32 +0000
commit126158251a6a5564192b31f85402e335765cf8de (patch)
treefb0293f19a9a315e341996e4b58b3ad614073c75 /sys/ufs
parentc1faa4bcfff27ff7d1a9775c859bbe2ab8721f83 (diff)
downloadFreeBSD-src-126158251a6a5564192b31f85402e335765cf8de.zip
FreeBSD-src-126158251a6a5564192b31f85402e335765cf8de.tar.gz
Call vn_close on the backing file vnode if ufs_extattr_enable failed to
avoid leaking it. Reviewed by: rwatson
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ufs/ufs_extattr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/ufs/ufs/ufs_extattr.c b/sys/ufs/ufs/ufs_extattr.c
index a43baea..b713267 100644
--- a/sys/ufs/ufs/ufs_extattr.c
+++ b/sys/ufs/ufs/ufs_extattr.c
@@ -345,7 +345,10 @@ ufs_extattr_enable_with_open(struct ufsmount *ump, struct vnode *vp,
VOP_UNLOCK(vp, 0, p);
- return (ufs_extattr_enable(ump, attrnamespace, attrname, vp, p));
+ error = ufs_extattr_enable(ump, attrnamespace, attrname, vp, p);
+ if (error != 0)
+ vn_close(vp, FREAD|FWRITE, p->p_ucred, p);
+ return (error);
}
#ifdef UFS_EXTATTR_AUTOSTART
OpenPOWER on IntegriCloud