time: ntp: fix bug in ntp_update_offset() & do_adjtimex(), fix
authorJohn Stultz <johnstul@us.ibm.com>
Thu, 26 Feb 2009 17:46:14 +0000 (09:46 -0800)
committerIngo Molnar <mingo@elte.hu>
Thu, 26 Feb 2009 18:39:47 +0000 (19:39 +0100)
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>
kernel/time/ntp.c

index c74eb7d9d854269a3a43e308e3aea3c18e3ffb87..7fc64375ff43350ce59cb3a1d0db220c57d79a46 100644 (file)
@@ -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) {