Title: [7486] trunk/kernel/time/timecompare.c: Fix half-Y2K38 bug in timecompare_update()
Revision
7486
Author
bhsong
Date
2009-09-28 04:54:39 -0400 (Mon, 28 Sep 2009)

Log Message

Fix half-Y2K38 bug in timecompare_update()
ktime will overflow from 03:14:07 UTC on Tuesday, 19 January 2038, ktime_add() will overflow a half earlier, from 2009.
This will cause some problems. For example, ptpd will encouter Y2K38 overflow due to that.

Modified Paths

Diff

Modified: trunk/kernel/time/timecompare.c (7485 => 7486)


--- trunk/kernel/time/timecompare.c	2009-09-28 08:51:44 UTC (rev 7485)
+++ trunk/kernel/time/timecompare.c	2009-09-28 08:54:39 UTC (rev 7486)
@@ -89,7 +89,7 @@
 			 * source time
 			 */
 			sample.offset =
-				ktime_to_ns(ktime_add(end, start)) / 2 -
+				(ktime_to_ns(end) + ktime_to_ns(start)) / 2 -
 				ts;
 
 			/* simple insertion sort based on duration */
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to