Commit a2a5ac8650b570bea3cb3614f77739dcd07d6632
Committed by
Ingo Molnar
1 parent
39854fe8c1
Exists in
master
and in
7 other branches
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>
Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff
kernel/time/ntp.c
... | ... | @@ -365,8 +365,6 @@ |
365 | 365 | time_state = TIME_OK; |
366 | 366 | time_status = STA_UNSYNC; |
367 | 367 | } |
368 | - /* only set allowed bits */ | |
369 | - time_status &= STA_RONLY; | |
370 | 368 | |
371 | 369 | /* |
372 | 370 | * If we turn on PLL adjustments then reset the |
... | ... | @@ -375,6 +373,8 @@ |
375 | 373 | if (!(time_status & STA_PLL) && (txc->status & STA_PLL)) |
376 | 374 | time_reftime = xtime.tv_sec; |
377 | 375 | |
376 | + /* only set allowed bits */ | |
377 | + time_status &= STA_RONLY; | |
378 | 378 | time_status |= txc->status & ~STA_RONLY; |
379 | 379 | |
380 | 380 | switch (time_state) { |