From: semarie Date: Mon, 27 Jun 2016 04:26:41 +0000 (+0000) Subject: dovutimens: call vrele(9) before returning EINVAL X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1ea6607aa6730da39d4a03ac83f0cea5e5559da5;p=openbsd dovutimens: call vrele(9) before returning EINVAL ok guenther@ --- 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]; }