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:
Wenjie Xu 2018-12-07 15:31:36 +08:00 committed by Carles Cufí
commit ce43d428c0

View file

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