summaryrefslogtreecommitdiffstats
path: root/kernel/time/ntp.c
diff options
context:
space:
mode:
authorJohn Stultz <johnstul@us.ibm.com>2009-02-26 18:46:14 +0100
committerIngo Molnar <mingo@elte.hu>2009-02-26 19:39:47 +0100
commita2a5ac8650b570bea3cb3614f77739dcd07d6632 (patch)
tree366d8184698c17103ca68b4a51b47b0c63771186 /kernel/time/ntp.c
parenttime: ntp: clean up second_overflow() (diff)
downloadlinux-a2a5ac8650b570bea3cb3614f77739dcd07d6632.tar.xz
linux-a2a5ac8650b570bea3cb3614f77739dcd07d6632.zip
time: ntp: fix bug in ntp_update_offset() & do_adjtimex(), fix
The time_status conditional was accidentally placed right after we clear the checked time_status bits, which causes us to take the conditional every time through. This fixes it by moving the conditional to before we clear the time_status bits. Signed-off-by: John Stultz <johnstul@us.ibm.com> Cc: Clark Williams <williams@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/time/ntp.c')
-rw-r--r--kernel/time/ntp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index c74eb7d9d854..7fc64375ff43 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
@@ -365,8 +365,6 @@ static inline void process_adj_status(struct timex *txc, struct timespec *ts)
time_state = TIME_OK;
time_status = STA_UNSYNC;
}
- /* only set allowed bits */
- time_status &= STA_RONLY;
/*
* If we turn on PLL adjustments then reset the
@@ -375,6 +373,8 @@ static inline void process_adj_status(struct timex *txc, struct timespec *ts)
if (!(time_status & STA_PLL) && (txc->status & STA_PLL))
time_reftime = xtime.tv_sec;
+ /* only set allowed bits */
+ time_status &= STA_RONLY;
time_status |= txc->status & ~STA_RONLY;
switch (time_state) {