diff options
author | 2016-06-27 04:26:41 +0000 | |
---|---|---|
committer | 2016-06-27 04:26:41 +0000 | |
commit | 1ea6607aa6730da39d4a03ac83f0cea5e5559da5 (patch) | |
tree | 7b7ade02921be53b2f266e0195ab5b02309a51d3 /sys | |
parent | sys_revoke: call vrele() before returning ENOTTY (diff) | |
download | wireguard-openbsd-1ea6607aa6730da39d4a03ac83f0cea5e5559da5.tar.xz wireguard-openbsd-1ea6607aa6730da39d4a03ac83f0cea5e5559da5.zip |
dovutimens: call vrele(9) before returning EINVAL
ok guenther@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/vfs_syscalls.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index dd43f160caf..8593d170f7a 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_syscalls.c,v 1.258 2016/06/27 04:14:38 semarie Exp $ */ +/* $OpenBSD: vfs_syscalls.c,v 1.259 2016/06/27 04:26:41 semarie Exp $ */ /* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */ /* @@ -2332,13 +2332,17 @@ dovutimens(struct proc *p, struct vnode *vp, struct timespec ts[2]) } if (ts[0].tv_nsec != UTIME_OMIT) { - if (ts[0].tv_nsec < 0 || ts[0].tv_nsec >= 1000000000) + if (ts[0].tv_nsec < 0 || ts[0].tv_nsec >= 1000000000) { + vrele(vp); return (EINVAL); + } vattr.va_atime = ts[0]; } if (ts[1].tv_nsec != UTIME_OMIT) { - if (ts[1].tv_nsec < 0 || ts[1].tv_nsec >= 1000000000) + if (ts[1].tv_nsec < 0 || ts[1].tv_nsec >= 1000000000) { + vrele(vp); return (EINVAL); + } vattr.va_mtime = ts[1]; } |