Skip to content

Commit 1b7eae4

Browse files
lyakhkartben
authored andcommitted
logging: mtrace: don't activate with hook == NULL
adsp_mtrace_log_init() can be called with its argument equal NULL, mtrace_active shouldn't be set to true in that case. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent 1f7a694 commit 1b7eae4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

subsys/logging/backends/log_backend_adsp_mtrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ void adsp_mtrace_log_init(adsp_mtrace_log_hook_t hook)
221221
mtrace_init();
222222

223223
mtrace_hook = hook;
224-
mtrace_active = true;
224+
mtrace_active = !!hook;
225225
}
226226

227227
const struct log_backend *log_backend_adsp_mtrace_get(void)

0 commit comments

Comments
 (0)