aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time
diff options
context:
space:
mode:
authorRichard Cochran <richardcochran@gmail.com>2011-02-18 04:07:25 -0500
committerThomas Gleixner <tglx@linutronix.de>2011-02-18 11:01:12 -0500
commitdb1c1cce4a653dcbe6949c72ae7b9f42cab1b929 (patch)
treec90203be70d8fbe19e462e45f0573e34208a8927 /kernel/time
parent22b7fcdae562b6792b3f5517e89fd7e0337180ae (diff)
ntp: Remove redundant and incorrect parameter check
The ADJ_SETOFFSET code redundantly checks the range of the nanoseconds field of the time value. This field is checked again in the subsequent call to timekeeping_inject_offset(). Also, as is, the check will not detect whether the number of microseconds is out of range. Let timekeeping_inject_offset() do the error checking. Signed-off-by: Richard Cochran <richard.cochran@omicron.at> Cc: johnstul@us.ibm.com LKML-Reference: <20110218090724.GA2924@riccoc20.at.omicron.at> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/time')
-rw-r--r--kernel/time/ntp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index 5ac593267a26..5f1bb8e2008f 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
@@ -650,13 +650,13 @@ int do_adjtimex(struct timex *txc)
650 650
651 if (txc->modes & ADJ_SETOFFSET) { 651 if (txc->modes & ADJ_SETOFFSET) {
652 struct timespec delta; 652 struct timespec delta;
653 if ((unsigned long)txc->time.tv_usec >= NSEC_PER_SEC)
654 return -EINVAL;
655 delta.tv_sec = txc->time.tv_sec; 653 delta.tv_sec = txc->time.tv_sec;
656 delta.tv_nsec = txc->time.tv_usec; 654 delta.tv_nsec = txc->time.tv_usec;
657 if (!(txc->modes & ADJ_NANO)) 655 if (!(txc->modes & ADJ_NANO))
658 delta.tv_nsec *= 1000; 656 delta.tv_nsec *= 1000;
659 timekeeping_inject_offset(&delta); 657 result = timekeeping_inject_offset(&delta);
658 if (result)
659 return result;
660 } 660 }
661 661
662 getnstimeofday(&ts); 662 getnstimeofday(&ts);