projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Merge remote-tracking branches 'regulator/topic/axp20x', 'regulator/topic/da9211...
[firefly-linux-kernel-4.4.55.git]
/
kernel
/
time
/
ntp.c
diff --git
a/kernel/time/ntp.c
b/kernel/time/ntp.c
index 87a346fd6d61ff1c5c1045c9db063ee3247d2361..28bf91c60a0b412d1c97911659c30d735ba40d78 100644
(file)
--- 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;
}