Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jul 2016 09:50:07 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r302740 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201607130950.u6D9o7iS096335@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Wed Jul 13 09:50:07 2016
New Revision: 302740
URL: https://svnweb.freebsd.org/changeset/base/302740

Log:
  MFC r301273: zfs_root: fix a potential root vnode reference leak

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c	Wed Jul 13 09:48:04 2016	(r302739)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c	Wed Jul 13 09:50:07 2016	(r302740)
@@ -1781,11 +1781,13 @@ zfs_root(vfs_t *vfsp, int flags, vnode_t
 
 	ZFS_EXIT(zfsvfs);
 
-	if (error == 0)
+	if (error == 0) {
 		error = vn_lock(*vpp, flags);
-	if (error != 0)
-		*vpp = NULL;
-
+		if (error != 0) {
+			VN_RELE(*vpp);
+			*vpp = NULL;
+		}
+	}
 	return (error);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607130950.u6D9o7iS096335>