aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time/timekeeping.c
diff options
context:
space:
mode:
authorJohn Stultz <john.stultz@linaro.org>2013-03-22 12:08:52 -0700
committerJohn Stultz <john.stultz@linaro.org>2013-04-04 13:18:14 -0700
commite4085693f629ded8ac8c35b5cdd324d20242990b (patch)
tree757707d15089ed0386b7f25bfa019cdfe9b44024 /kernel/time/timekeeping.c
parentntp: Move do_adjtimex() and hardpps() functions to timekeeping.c (diff)
downloadlinux-dev-e4085693f629ded8ac8c35b5cdd324d20242990b.tar.xz
linux-dev-e4085693f629ded8ac8c35b5cdd324d20242990b.zip
ntp: Move timex validation to timekeeping do_adjtimex call.
Move logic that does not need the ntp state to be done in the timekeeping do_adjtimex() call. Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Richard Cochran <richardcochran@gmail.com> Cc: Prarit Bhargava <prarit@redhat.com> Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to '')
-rw-r--r--kernel/time/timekeeping.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index a138ec2cde3e..f6c8a7279157 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1618,6 +1618,13 @@ EXPORT_SYMBOL_GPL(ktime_get_monotonic_offset);
*/
int do_adjtimex(struct timex *txc)
{
+ int ret;
+
+ /* Validate the data before disabling interrupts */
+ ret = ntp_validate_timex(txc);
+ if (ret)
+ return ret;
+
return __do_adjtimex(txc);
}