summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2018-07-27 01:44:20 +0000
committerBob Beck <beck@cvs.openbsd.org>2018-07-27 01:44:20 +0000
commitd0eb4a967b4cfe7d58de5100f6391031682b206c (patch)
tree94932228809c8219e4d66599b80978619e2784cb
parentb0c8bb8fff039d6c8d2745f1657be8d65ca9de31 (diff)
Don't double vput and panic after looking up "."
-rw-r--r--sys/kern/vfs_syscalls.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index ec5d7a853a8..768a5676736 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_syscalls.c,v 1.295 2018/07/22 06:31:17 anton Exp $ */
+/* $OpenBSD: vfs_syscalls.c,v 1.296 2018/07/27 01:44:19 beck Exp $ */
/* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */
/*
@@ -945,7 +945,7 @@ sys_unveil(struct proc *p, void *v, register_t *retval)
/* release vref and lock from namei, but not vref from ppath_add */
if (nd.ni_vp)
vput(nd.ni_vp);
- if (nd.ni_dvp)
+ if (nd.ni_dvp && nd.ni_dvp != nd.ni_vp)
vput(nd.ni_dvp);
return (error);
}