Skip to content

Commit

Permalink
time: ntp: fix bug in ntp_update_offset() & do_adjtimex(), fix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
John Stultz authored and Ingo Molnar committed Feb 26, 2009
1 parent 39854fe commit a2a5ac8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/time/ntp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand Down

0 comments on commit a2a5ac8

Please sign in to comment.