From: semarie Date: Mon, 27 Jun 2016 04:14:38 +0000 (+0000) Subject: sys_revoke: call vrele() before returning ENOTTY X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=98c3ae45d04161fe8a7a5e8f4ba46d7277fb7aa7;p=openbsd sys_revoke: call vrele() before returning ENOTTY ok guenther@ --- diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index ffaaefa6380..dd43f160caf 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_syscalls.c,v 1.257 2016/06/26 14:27:14 semarie Exp $ */ +/* $OpenBSD: vfs_syscalls.c,v 1.258 2016/06/27 04:14:38 semarie Exp $ */ /* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */ /* @@ -2796,8 +2796,10 @@ sys_revoke(struct proc *p, void *v, register_t *retval) return (error); vp = nd.ni_vp; if (vp->v_type != VCHR || (u_int)major(vp->v_rdev) >= nchrdev || - cdevsw[major(vp->v_rdev)].d_type != D_TTY) - return (ENOTTY); + cdevsw[major(vp->v_rdev)].d_type != D_TTY) { + error = ENOTTY; + goto out; + } if ((error = VOP_GETATTR(vp, &vattr, p->p_ucred, p)) != 0) goto out; if (p->p_ucred->cr_uid != vattr.va_uid &&