]> err.no Git - linux-2.6/commitdiff
[PATCH] time_adjust cleared before use
authorJim Houston <jim.houston@comcast.net>
Sat, 28 Oct 2006 17:38:56 +0000 (10:38 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sat, 28 Oct 2006 18:30:55 +0000 (11:30 -0700)
I notice that the code which implements adjtime clears the time_adjust
value before using it.  The attached patch makes the obvious fix.

Acked-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Jim Houston <jim.houston@ccur.com>
Cc: John Stultz <johnstul@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/time/ntp.c

index 47195fa0ec4f29b09ba7a2294b8863e829b089d7..3afeaa3a73f998dd422e1518c6c4256749207538 100644 (file)
@@ -161,9 +161,9 @@ void second_overflow(void)
                        time_adjust += MAX_TICKADJ;
                        tick_length -= MAX_TICKADJ_SCALED;
                } else {
-                       time_adjust = 0;
                        tick_length += (s64)(time_adjust * NSEC_PER_USEC /
                                             HZ) << TICK_LENGTH_SHIFT;
+                       time_adjust = 0;
                }
        }
 }