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 <jakub.rzeszutko@verkada.com>
This commit is contained in:
Jakub Rzeszutko 2024-02-29 03:11:04 +01:00 committed by Alberto Escolar
commit 1261745b2c

View file

@ -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;
}