Skip to content

Commit e710139

Browse files
committed
[nrf fromtree] kernel: work: work timeout handler uninitialized variables fix
work and handler pointers are local and not initialized. Initialize them with NULL to avoid compiler error maybe-uninitialized. Signed-off-by: Łukasz Stępnicki <[email protected]> (cherry picked from commit 6571f4e)
1 parent 648dcba commit e710139

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/work.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,8 +606,8 @@ bool k_work_cancel_sync(struct k_work *work,
606606
static void work_timeout_handler(struct _timeout *record)
607607
{
608608
struct k_work_q *queue = CONTAINER_OF(record, struct k_work_q, work_timeout_record);
609-
struct k_work *work;
610-
k_work_handler_t handler;
609+
struct k_work *work = NULL;
610+
k_work_handler_t handler = NULL;
611611
const char *name;
612612
const char *space = " ";
613613

0 commit comments

Comments
 (0)