Bluetooth: shell: Fix NULL shell context
On bt_ready, ctx_shell would be NULL if not initialized before bt_enable. Signed-off-by: Wenjie Xu <xuwenjie@huantengsmart.com>
This commit is contained in:
parent
c5de716af4
commit
ce43d428c0
1 changed files with 2 additions and 2 deletions
|
@ -325,13 +325,13 @@ static int cmd_init(const struct shell *shell, size_t argc, char *argv[])
|
|||
{
|
||||
int err;
|
||||
|
||||
ctx_shell = shell;
|
||||
|
||||
err = bt_enable(bt_ready);
|
||||
if (err) {
|
||||
shell_error(shell, "Bluetooth init failed (err %d)", err);
|
||||
}
|
||||
|
||||
ctx_shell = shell;
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue