task_wdt: fix overflow in current_ticks making wdt get stuck

The task_wdt was getting stuck after approx. 36 hours on e.g. nRF52840,
which has a SysTick with 32768 Hz. This corresponds to an overflow of
the uint32_t current_ticks in schedule_next_timeout.

This commit fixes the accidentally introduced narrowing conversion.

Fixes #40152

Signed-off-by: Martin Jäger <martin@libre.solar>
This commit is contained in:
Martin Jäger 2021-11-15 14:44:32 +01:00 committed by Anas Nashif
parent 1123b80aee
commit 98d2d2feda

View file

@ -50,7 +50,7 @@ static int hw_wdt_channel;
static bool hw_wdt_started; static bool hw_wdt_started;
#endif #endif
static void schedule_next_timeout(uint32_t current_ticks) static void schedule_next_timeout(int64_t current_ticks)
{ {
int next_channel_id; /* channel which will time out next */ int next_channel_id; /* channel which will time out next */
int64_t next_timeout; /* timeout in absolute ticks of this channel */ int64_t next_timeout; /* timeout in absolute ticks of this channel */