]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
watchdog: rzg2l_wdt: Fix 32bit overflow issue
authorBiju Das <biju.das.jz@bp.renesas.com>
Fri, 25 Feb 2022 17:53:14 +0000 (17:53 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2022 16:41:16 +0000 (18:41 +0200)
commite07b9fa0dc32b492de85528caaf9f0c605d8424f
treec6e7460b5acad2193daf2dcc981424585a3abc66
parent66b04734cd6ddd654530c12665c57de49c8cd8e2
watchdog: rzg2l_wdt: Fix 32bit overflow issue

[ Upstream commit ea2949df22a533cdf75e4583c00b1ce94cd5a83b ]

The value of timer_cycle_us can be 0 due to 32bit overflow.
For eg:- If we assign the counter value "0xfff" for computing
maxval.

This patch fixes this issue by appending ULL to 1024, so that
it is promoted to 64bit.

This patch also fixes the warning message, 'watchdog: Invalid min and
max timeout values, resetting to 0!'.

Fixes: 2cbc5cd0b55fa2 ("watchdog: Add Watchdog Timer driver for RZ/G2L")
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20220225175320.11041-2-biju.das.jz@bp.renesas.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/watchdog/rzg2l_wdt.c