diff --git a/subsys/logging/log_core.c b/subsys/logging/log_core.c index 1ecac6e99b5..6eb71eeddd4 100644 --- a/subsys/logging/log_core.c +++ b/subsys/logging/log_core.c @@ -85,7 +85,7 @@ static bool backend_attached; static atomic_t buffered_cnt; static atomic_t dropped_cnt; static k_tid_t proc_tid; -static uint32_t log_strdup_in_use; +static atomic_t log_strdup_in_use; static uint32_t log_strdup_max; static uint32_t log_strdup_longest; static struct k_timer log_process_thread_timer; @@ -939,7 +939,7 @@ void z_log_free(void *str) if (atomic_dec(&dup->refcount) == 1) { k_mem_slab_free(&log_strdup_pool, (void **)&dup); if (IS_ENABLED(CONFIG_LOG_STRDUP_POOL_PROFILING)) { - atomic_dec((atomic_t *)&log_strdup_in_use); + atomic_dec(&log_strdup_in_use); } } }