diff --git a/kernel/timeout.c b/kernel/timeout.c index eb1418000ff..523a7a47c48 100644 --- a/kernel/timeout.c +++ b/kernel/timeout.c @@ -86,6 +86,10 @@ static s32_t next_timeout(void) void z_add_timeout(struct _timeout *to, _timeout_func_t fn, k_timeout_t timeout) { + if (K_TIMEOUT_EQ(timeout, K_FOREVER)) { + return; + } + #ifdef CONFIG_LEGACY_TIMEOUT_API k_ticks_t ticks = timeout; #else