diff options
| author | John Stultz <johnstul@us.ibm.com> | 2009-02-26 12:46:14 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-02-26 13:39:47 -0500 |
| commit | a2a5ac8650b570bea3cb3614f77739dcd07d6632 (patch) | |
| tree | 366d8184698c17103ca68b4a51b47b0c63771186 | |
| parent | 39854fe8c165872d743f6a0c4860ca2de8e45ac9 (diff) | |
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>
| -rw-r--r-- | kernel/time/ntp.c | 4 |
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) | |||
| 365 | time_state = TIME_OK; | 365 | time_state = TIME_OK; |
| 366 | time_status = STA_UNSYNC; | 366 | time_status = STA_UNSYNC; |
| 367 | } | 367 | } |
| 368 | /* only set allowed bits */ | ||
| 369 | time_status &= STA_RONLY; | ||
| 370 | 368 | ||
| 371 | /* | 369 | /* |
| 372 | * If we turn on PLL adjustments then reset the | 370 | * 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) | |||
| 375 | if (!(time_status & STA_PLL) && (txc->status & STA_PLL)) | 373 | if (!(time_status & STA_PLL) && (txc->status & STA_PLL)) |
| 376 | time_reftime = xtime.tv_sec; | 374 | time_reftime = xtime.tv_sec; |
| 377 | 375 | ||
| 376 | /* only set allowed bits */ | ||
| 377 | time_status &= STA_RONLY; | ||
| 378 | time_status |= txc->status & ~STA_RONLY; | 378 | time_status |= txc->status & ~STA_RONLY; |
| 379 | 379 | ||
| 380 | switch (time_state) { | 380 | switch (time_state) { |
