summaryrefslogtreecommitdiffstats
path: root/kernel/time/ntp.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2015-02-15 16:07:18 -0800
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-02-15 16:07:18 -0800
commit97ae2b5c17d6cc988c6d49ae0cf95befb6b7081c (patch)
treea71115af6c30fdc9de0878e2cf1c51e95b17a324 /kernel/time/ntp.c
parentef47fa5280819deaa8da7e0db1d875b225de5838 (diff)
parentc8af781ebf3ffe37c18c34ca89e29c085560e561 (diff)
downloadop-kernel-dev-97ae2b5c17d6cc988c6d49ae0cf95befb6b7081c.zip
op-kernel-dev-97ae2b5c17d6cc988c6d49ae0cf95befb6b7081c.tar.gz
Merge branch 'bfin_rotary' into next
Merge bfin_rotary driver changes from Sonic Zhang.
Diffstat (limited to 'kernel/time/ntp.c')
-rw-r--r--kernel/time/ntp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index 87a346f..28bf91c 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
@@ -633,6 +633,13 @@ int ntp_validate_timex(struct timex *txc)
if ((txc->modes & ADJ_SETOFFSET) && (!capable(CAP_SYS_TIME)))
return -EPERM;
+ if (txc->modes & ADJ_FREQUENCY) {
+ if (LONG_MIN / PPM_SCALE > txc->freq)
+ return -EINVAL;
+ if (LONG_MAX / PPM_SCALE < txc->freq)
+ return -EINVAL;
+ }
+
return 0;
}
OpenPOWER on IntegriCloud