logging: Initialize 'chosen' pointer in z_log_msg_claim_oldest to NULL

Fixes a compiler warning 'chosen' may be uninitialized when later
dereferenced

Signed-off-by: Jacob McClellan <mcclellanjacob@meta.com>
This commit is contained in:
Jacob McClellan 2024-10-16 17:36:55 -07:00 committed by Mahesh Mahadevan
parent f889c1abab
commit 39042dc9cc
1 changed files with 1 additions and 1 deletions

View File

@ -705,7 +705,7 @@ union log_msg_generic *z_log_msg_local_claim(void)
union log_msg_generic *z_log_msg_claim_oldest(k_timeout_t *backoff)
{
union log_msg_generic *msg = NULL;
struct log_msg_ptr *chosen;
struct log_msg_ptr *chosen = NULL;
log_timestamp_t t_min = sizeof(log_timestamp_t) > sizeof(uint32_t) ?
UINT64_MAX : UINT32_MAX;
int i = 0;