timekeeping: Copy the shadow-timekeeper over the real timekeeper last
[cascardo/linux.git] / kernel / time / timekeeping.c
index 5d67ffb..30b7a40 100644 (file)
@@ -1853,8 +1853,9 @@ void update_wall_time(void)
         * memcpy under the tk_core.seq against one before we start
         * updating.
         */
+       timekeeping_update(tk, clock_set);
        memcpy(real_tk, tk, sizeof(*tk));
-       timekeeping_update(real_tk, clock_set);
+       /* The memcpy must come last. Do not put anything here! */
        write_seqcount_end(&tk_core.seq);
 out:
        raw_spin_unlock_irqrestore(&timekeeper_lock, flags);