From 1261745b2c19db453f9972018d031ab66a7827c8 Mon Sep 17 00:00:00 2001 From: Jakub Rzeszutko Date: Thu, 29 Feb 2024 03:11:04 +0100 Subject: [PATCH] shell: fix shell_stop command Added missing condition to check if log backend is configured before calling the function: z_shell_log_backend_disable. Without this, in some configurations, a compilation error appeared due to calling a non-existent function. Fixes: #69555 Signed-off-by: Jakub Rzeszutko --- subsys/shell/shell.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/subsys/shell/shell.c b/subsys/shell/shell.c index acbe9ea11a9f..9cbd8a7158af 100644 --- a/subsys/shell/shell.c +++ b/subsys/shell/shell.c @@ -1465,7 +1465,9 @@ int shell_stop(const struct shell *sh) state_set(sh, SHELL_STATE_INITIALIZED); - z_shell_log_backend_disable(sh->log_backend); + if (IS_ENABLED(CONFIG_SHELL_LOG_BACKEND)) { + z_shell_log_backend_disable(sh->log_backend); + } return 0; }