From b787db24c751527653af0a097e3b1771834c6c61 Mon Sep 17 00:00:00 2001 From: beck Date: Fri, 27 Jul 2018 01:44:19 +0000 Subject: [PATCH] Don't double vput and panic after looking up "." --- sys/kern/vfs_syscalls.c | 4 ++-- 1 file 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); } -- 2.20.1