subsys/shell: check for shell context before accessing it
The ASSERT order is backwards, where the shell->ctx is being accessed before it is being checked as valid. Moving the check for the shell->ctx to before the using it. Signed-off-by: Dan Kalowsky <dkalowsky@amperecomputing.com>
This commit is contained in:
parent
3633860ff1
commit
305ba26c6e
1 changed files with 1 additions and 1 deletions
|
@ -1408,9 +1408,9 @@ void shell_vfprintf(const struct shell *shell, enum shell_vt100_color color,
|
||||||
{
|
{
|
||||||
__ASSERT_NO_MSG(shell);
|
__ASSERT_NO_MSG(shell);
|
||||||
__ASSERT(!k_is_in_isr(), "Thread context required.");
|
__ASSERT(!k_is_in_isr(), "Thread context required.");
|
||||||
|
__ASSERT_NO_MSG(shell->ctx);
|
||||||
__ASSERT_NO_MSG((shell->ctx->internal.flags.cmd_ctx == 1) ||
|
__ASSERT_NO_MSG((shell->ctx->internal.flags.cmd_ctx == 1) ||
|
||||||
(k_current_get() != shell->ctx->tid));
|
(k_current_get() != shell->ctx->tid));
|
||||||
__ASSERT_NO_MSG(shell->ctx);
|
|
||||||
__ASSERT_NO_MSG(shell->fprintf_ctx);
|
__ASSERT_NO_MSG(shell->fprintf_ctx);
|
||||||
__ASSERT_NO_MSG(fmt);
|
__ASSERT_NO_MSG(fmt);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue