Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth: shell: Fix null check in cmd_conn_phy_update #34203

Merged
merged 1 commit into from
Apr 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions subsys/bluetooth/shell/bt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2141,6 +2141,13 @@ static int cmd_conn_phy_update(const struct shell *shell, size_t argc,
struct bt_conn_le_phy_param param;
int err;

if (default_conn == NULL) {
shell_error(shell,
"%s: at least, one connection is required",
shell->ctx->active_cmd.syntax);
return -ENOEXEC;
}

param.pref_tx_phy = strtoul(argv[1], NULL, 16);
param.pref_rx_phy = param.pref_tx_phy;
param.options = BT_CONN_LE_PHY_OPT_NONE;
Expand Down