Commit 85dc8f05 authored by Andreas Schwab's avatar Andreas Schwab Committed by Thomas Gleixner

time: Fix casting issue in timekeeping_forward_now

arch_gettimeoffset returns a u32 value which when shifted by tk->shift
can overflow. This issue was introduced with 1e75fa8b (time: Condense
timekeeper.xtime into xtime_sec)

Cast it to u64 first.
Signed-off-by: default avatarAndreas Schwab <schwab@linux-m68k.org>
Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
Cc: Prarit Bhargava <prarit@redhat.com>
Cc: Ingo Molnar <mingo@kernel.org>
Link: http://lkml.kernel.org/r/1345595449-34965-3-git-send-email-john.stultz@linaro.orgSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 784ffcbb
...@@ -277,7 +277,7 @@ static void timekeeping_forward_now(struct timekeeper *tk) ...@@ -277,7 +277,7 @@ static void timekeeping_forward_now(struct timekeeper *tk)
tk->xtime_nsec += cycle_delta * tk->mult; tk->xtime_nsec += cycle_delta * tk->mult;
/* If arch requires, add in gettimeoffset() */ /* If arch requires, add in gettimeoffset() */
tk->xtime_nsec += arch_gettimeoffset() << tk->shift; tk->xtime_nsec += (u64)arch_gettimeoffset() << tk->shift;
tk_normalize_xtime(tk); tk_normalize_xtime(tk);
......
Markdown is supported
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