Skip to content

Commit

Permalink
shell: fix shell_stop command
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jakub-uC authored and aescolar committed Mar 4, 2024
1 parent 5bd03fd commit 1261745
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion subsys/shell/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 1261745

Please sign in to comment.