Commit c573b81e authored by Barry Song's avatar Barry Song Committed by james toy

ktime will overflow from 03:14:07 UTC on Tuesday, 19 January 2038,

ktime_add() in timecompare_update() will overflow a half earlier.  As a
result, wrong offset will be gotten, then cause some strange problems.
Signed-off-by: default avatarBarry Song <21cnbao@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Patrick Ohly <patrick.ohly@intel.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: John Stultz <johnstul@us.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 621935d0
...@@ -89,7 +89,7 @@ int timecompare_offset(struct timecompare *sync, ...@@ -89,7 +89,7 @@ int timecompare_offset(struct timecompare *sync,
* source time * source time
*/ */
sample.offset = sample.offset =
ktime_to_ns(ktime_add(end, start)) / 2 - (ktime_to_ns(end) + ktime_to_ns(start)) / 2 -
ts; ts;
/* simple insertion sort based on duration */ /* simple insertion sort based on duration */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment