From b810a47eb682d67542574a7715fd3ad53c0c22b2 Mon Sep 17 00:00:00 2001 From: Visa Hankala Date: Wed, 25 Apr 2018 15:53:09 +0000 Subject: Fix use of unreferenced vnode by decrementing the vnode's reference count after unlocking. To improve consistency, use vput() instead of VOP_UNLOCK() + vrele(). OK guenther@, mpi@, tedu@ --- sys/nfs/nfs_vnops.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sys/nfs') diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c index 480f9879897..aacaed26dac 100644 --- a/sys/nfs/nfs_vnops.c +++ b/sys/nfs/nfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_vnops.c,v 1.172 2018/04/17 07:45:24 mpi Exp $ */ +/* $OpenBSD: nfs_vnops.c,v 1.173 2018/04/25 15:53:08 visa Exp $ */ /* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */ /* @@ -986,9 +986,10 @@ nfsmout: nfs_cache_enter(dvp, NULL, cnp); } if (newvp != NULLVP) { - vrele(newvp); if (newvp != dvp) - VOP_UNLOCK(newvp, p); + vput(newvp); + else + vrele(newvp); } if ((cnp->cn_nameiop == CREATE || cnp->cn_nameiop == RENAME) && (flags & ISLASTCN) && error == ENOENT) { -- cgit v1.2.3