Skip to content

Commit f67e12a

Browse files
Thalleycarlescufi
authored andcommitted
Bluetooth: ISO: Add check for can_send in bt_iso_chan_send
Ensure that we don't attempt to send any data to the controller if `can_send` is not set, and return an error code to the application instead. Signed-off-by: Emil Gydesen <[email protected]>
1 parent 24e38e9 commit f67e12a

File tree

1 file changed

+4
-0
lines changed
  • subsys/bluetooth/host

1 file changed

+4
-0
lines changed

subsys/bluetooth/host/iso.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,10 @@ int bt_iso_chan_send(struct bt_iso_chan *chan, struct net_buf *buf)
696696
}
697697

698698
iso_conn = chan->iso;
699+
if (!iso_conn->iso.can_send) {
700+
BT_DBG("Channel not able to send");
701+
return -EINVAL;
702+
}
699703

700704
hdr = net_buf_push(buf, sizeof(*hdr));
701705
hdr->sn = sys_cpu_to_le16(iso_conn->iso.seq_num);

0 commit comments

Comments
 (0)