aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/posix-timers.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
index 69d5a4b5395b..6b851a1bf4b0 100644
--- a/kernel/posix-timers.c
+++ b/kernel/posix-timers.c
@@ -712,8 +712,7 @@ out:
712 */ 712 */
713static int good_timespec(const struct timespec *ts) 713static int good_timespec(const struct timespec *ts)
714{ 714{
715 if ((!ts) || (ts->tv_sec < 0) || 715 if ((!ts) || !timespec_valid(ts))
716 ((unsigned) ts->tv_nsec >= NSEC_PER_SEC))
717 return 0; 716 return 0;
718 return 1; 717 return 1;
719} 718}
@@ -1406,7 +1405,7 @@ sys_clock_nanosleep(const clockid_t which_clock, int flags,
1406 if (copy_from_user(&t, rqtp, sizeof (struct timespec))) 1405 if (copy_from_user(&t, rqtp, sizeof (struct timespec)))
1407 return -EFAULT; 1406 return -EFAULT;
1408 1407
1409 if ((unsigned) t.tv_nsec >= NSEC_PER_SEC || t.tv_sec < 0) 1408 if (!timespec_valid(&t))
1410 return -EINVAL; 1409 return -EINVAL;
1411 1410
1412 /* 1411 /*