Message ID | 163977936091.23020.4635277365571231741.tip-bot2@tip-bot2 |
---|---|
State | New |
Headers | show |
Series | [tip:,timers/urgent] timekeeping: Really make sure wall_to_monotonic isn't positive | expand |
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index b348749..dcdcb85 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -1306,8 +1306,7 @@ int do_settimeofday64(const struct timespec64 *ts) timekeeping_forward_now(tk); xt = tk_xtime(tk); - ts_delta.tv_sec = ts->tv_sec - xt.tv_sec; - ts_delta.tv_nsec = ts->tv_nsec - xt.tv_nsec; + ts_delta = timespec64_sub(*ts, xt); if (timespec64_compare(&tk->wall_to_monotonic, &ts_delta) > 0) { ret = -EINVAL;