Skip to content
Commit 0e23ad88 authored by Leandro Pereira's avatar Leandro Pereira Committed by Anas Nashif
Browse files

kernel: k_work: k_work_init() should initialize all fields



k_work_init() was not initializing all fields in the k_work struct.

Mainly, the atomic_clear_bit() function call was reading a possibly
uninitialized value, clearing a bit, and assigning it back to the
`flags` member.  The `_reserved` member was never initialized.

With the struct now initialized with the _K_WORK_INITIALIZER() macro,
initialization is consistent regardless of how a `struct k_work` is
initialized.

This fixes the Valgrind issues found in #7478.

Signed-off-by: default avatarLeandro Pereira <leandro.pereira@intel.com>
parent a026b9ea
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment