diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2018-04-25 15:53:09 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2018-04-25 15:53:09 +0000 |
commit | b810a47eb682d67542574a7715fd3ad53c0c22b2 (patch) | |
tree | ef3d2b71c36cb9ae6b714f853021609ba6388c12 | |
parent | b17187a2390b46ca86cba95459870161839b63aa (diff) |
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@
-rw-r--r-- | sys/nfs/nfs_vnops.c | 7 |
1 files changed, 4 insertions, 3 deletions
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) { |