projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
PCI/PTM: Save/restore Precision Time Measurement Capability for suspend/resume
[linux-2.6-microblaze.git]
/
include
/
linux
/
time64.h
diff --git
a/include/linux/time64.h
b/include/linux/time64.h
index
c9dcb3e
..
5117cb5
100644
(file)
--- a/
include/linux/time64.h
+++ b/
include/linux/time64.h
@@
-124,6
+124,10
@@
static inline bool timespec64_valid_settod(const struct timespec64 *ts)
*/
static inline s64 timespec64_to_ns(const struct timespec64 *ts)
{
+ /* Prevent multiplication overflow */
+ if ((unsigned long long)ts->tv_sec >= KTIME_SEC_MAX)
+ return KTIME_MAX;
+
return ((s64) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec;
}