timers: Fix overflow in get_next_timer_interrupt
authorMatija Glavinic Pecotic <matija.glavinic-pecotic.ext@nokia.com>
Tue, 1 Aug 2017 07:11:52 +0000 (09:11 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 1 Aug 2017 12:20:53 +0000 (14:20 +0200)
commit34f41c0316ed52b0b44542491d89278efdaa70e4
tree516368a46aae4e9b50b31457947b66649a3dccff
parent16f73eb02d7e1765ccab3d2018e0bd98eb93d973
timers: Fix overflow in get_next_timer_interrupt

For e.g. HZ=100, timer being 430 jiffies in the future, and 32 bit
unsigned int, there is an overflow on unsigned int right-hand side
of the expression which results with wrong values being returned.

Type cast the multiplier to 64bit to avoid that issue.

Fixes: 46c8f0b077a8 ("timers: Fix get_next_timer_interrupt() computation")
Signed-off-by: Matija Glavinic Pecotic <matija.glavinic-pecotic.ext@nokia.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
Cc: khilman@baylibre.com
Cc: akpm@linux-foundation.org
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/a7900f04-2a21-c9fd-67be-ab334d459ee5@nokia.com
kernel/time/timer.c