Skip to content
Commit cb2aa634 authored by John Stultz's avatar John Stultz Committed by Ingo Molnar
Browse files

time: Fix sign bug in NTP mult overflow warning

In commit 6067dc5a

 ("time: Avoid possible NTP adjustment
mult overflow") a new check was added to watch for adjustments
that could cause a mult overflow.

Unfortunately the check compares a signed with unsigned value
and ignored the case where the adjustment was negative, which
causes spurious warn-ons on some systems (and seems like it
would result in problematic time adjustments there as well, due
to the early return).

Thus this patch adds a check to make sure the adjustment is
positive before we check for an overflow, and resovles the issue
in my testing.

Reported-by: default avatarFengguang Wu <fengguang.wu@intel.com>
Debugged-by: default avatarpang.xunlei <pang.xunlei@linaro.org>
Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
Link: http://lkml.kernel.org/r/1416890145-30048-1-git-send-email-john.stultz@linaro.org
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 21b6c051
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment