Skip to content

Commit 372b786

Browse files
hermabefabiobaltieri
authored andcommitted
Bluetooth: Shell: Fix L2CAP ecred commands
The channel arrays must be null-terminated if it is less than 5 elements long. Signed-off-by: Herman Berget <[email protected]>
1 parent c2974e2 commit 372b786

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/bluetooth/shell/l2cap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ static int cmd_register(const struct shell *sh, size_t argc, char *argv[])
278278
#if defined(CONFIG_BT_L2CAP_ECRED)
279279
static int cmd_ecred_reconfigure(const struct shell *sh, size_t argc, char *argv[])
280280
{
281-
struct bt_l2cap_chan *l2cap_ecred_chans[1] = {&l2ch_chan.ch.chan};
281+
struct bt_l2cap_chan *l2cap_ecred_chans[] = { &l2ch_chan.ch.chan, NULL };
282282
uint16_t mtu;
283283
int err = 0;
284284

@@ -311,7 +311,7 @@ static int cmd_ecred_reconfigure(const struct shell *sh, size_t argc, char *argv
311311

312312
static int cmd_ecred_connect(const struct shell *sh, size_t argc, char *argv[])
313313
{
314-
struct bt_l2cap_chan *l2cap_ecred_chans[1] = {&l2ch_chan.ch.chan};
314+
struct bt_l2cap_chan *l2cap_ecred_chans[] = { &l2ch_chan.ch.chan, NULL };
315315
uint16_t psm;
316316
int err = 0;
317317

0 commit comments

Comments
 (0)