diff options
author | 2016-06-27 04:14:38 +0000 | |
---|---|---|
committer | 2016-06-27 04:14:38 +0000 | |
commit | 98c3ae45d04161fe8a7a5e8f4ba46d7277fb7aa7 (patch) | |
tree | db551f664e89d3e2f90d021d1c198e67470d2515 | |
parent | increase the minimum for auto rounds to 6. that was the previous low bound (diff) | |
download | wireguard-openbsd-98c3ae45d04161fe8a7a5e8f4ba46d7277fb7aa7.tar.xz wireguard-openbsd-98c3ae45d04161fe8a7a5e8f4ba46d7277fb7aa7.zip |
sys_revoke: call vrele() before returning ENOTTY
ok guenther@
-rw-r--r-- | sys/kern/vfs_syscalls.c | 8 |
1 files changed, 5 insertions, 3 deletions
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 && |