[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1345595449-34965-3-git-send-email-john.stultz@linaro.org>
Date: Tue, 21 Aug 2012 20:30:47 -0400
From: John Stultz <john.stultz@...aro.org>
To: linux-kernel <linux-kernel@...r.kernel.org>
Cc: Andreas Schwab <schwab@...ux-m68k.org>,
Ingo Molnar <mingo@...nel.org>,
Prarit Bhargava <prarit@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
John Stultz <john.stultz@...aro.org>
Subject: [PATCH 2/4] time: Fix casting issue in timekeeping_forward_now
From: Andreas Schwab <schwab@...ux-m68k.org>
arch_gettimeoffset returns a u32 value which when shifted by tk->shift can
overflow. Cast it to u64 first.
This issue was introduced with 1e75fa8be9fb61e1af46b5b3b176347a4c958ca1
Cc: Ingo Molnar <mingo@...nel.org>
Cc: Prarit Bhargava <prarit@...hat.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Signed-off-by: Andreas Schwab <schwab@...ux-m68k.org>
Signed-off-by: John Stultz <john.stultz@...aro.org>
---
kernel/time/timekeeping.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 258164a..1dbf80e 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -277,7 +277,7 @@ static void timekeeping_forward_now(struct timekeeper *tk)
tk->xtime_nsec += cycle_delta * tk->mult;
/* 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);
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists