diff options
author | pho <pho@FreeBSD.org> | 2011-12-03 12:35:13 +0000 |
---|---|---|
committer | pho <pho@FreeBSD.org> | 2011-12-03 12:35:13 +0000 |
commit | cbbd4e13dbc7802e27089b4dd004816b530ef41d (patch) | |
tree | 6f3d8e51bf6b205d8b1a7ef969dd3dfc230c697b /sys | |
parent | a28b8e75dcee4b70aa21214cb251bffc65955457 (diff) | |
download | FreeBSD-src-cbbd4e13dbc7802e27089b4dd004816b530ef41d.zip FreeBSD-src-cbbd4e13dbc7802e27089b4dd004816b530ef41d.tar.gz |
Use umtx_copyin_timeout() to copy and check timeout parameter.
In collaboration with: kib
MFC after: 1 week
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_thr.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c index 881fd55..5bcef04 100644 --- a/sys/kern/kern_thr.c +++ b/sys/kern/kern_thr.c @@ -450,8 +450,7 @@ sys_thr_suspend(struct thread *td, struct thr_suspend_args *uap) tsp = NULL; if (uap->timeout != NULL) { - error = copyin((const void *)uap->timeout, (void *)&ts, - sizeof(struct timespec)); + error = umtx_copyin_timeout(uap->timeout, &ts); if (error != 0) return (error); tsp = &ts; @@ -474,9 +473,6 @@ kern_thr_suspend(struct thread *td, struct timespec *tsp) } if (tsp != NULL) { - if (tsp->tv_sec < 0 || tsp->tv_nsec < 0 || - tsp->tv_nsec > 1000000000) - return (EINVAL); if (tsp->tv_sec == 0 && tsp->tv_nsec == 0) error = EWOULDBLOCK; else { |