summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/vfs_hash.c')
-rw-r--r--sys/kern/vfs_hash.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/vfs_hash.c b/sys/kern/vfs_hash.c
index 5b77b1f..72a0278 100644
--- a/sys/kern/vfs_hash.c
+++ b/sys/kern/vfs_hash.c
@@ -117,10 +117,10 @@ vfs_hash_insert(struct vnode *vp, u_int hash, int flags, struct thread *td, stru
error = vget(vp2, flags | LK_INTERLOCK, td);
if (error == ENOENT)
break;
- if (error)
- return (error);
- *vpp = vp2;
- return (0);
+ vput(vp);
+ if (!error)
+ *vpp = vp2;
+ return (error);
}
if (vp2 == NULL)
break;
OpenPOWER on IntegriCloud