Skip to content

Commit 83396d9

Browse files
Thalleycarlescufi
authored andcommitted
Bluetooth: ISO: Fix segmentation fault for disconnecting BIS
The bt_iso_chan_disconnected assumes a CIS, but was also used for BIS, so whenever it was called it attempted to get a non-existing ACL connection. Signed-off-by: Emil Gydesen <[email protected]>
1 parent d3a94fa commit 83396d9

File tree

1 file changed

+9
-5
lines changed
  • subsys/bluetooth/host

1 file changed

+9
-5
lines changed

subsys/bluetooth/host/iso.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -775,12 +775,16 @@ static void bt_iso_chan_disconnected(struct bt_iso_chan *chan, uint8_t reason)
775775
return;
776776
}
777777

778-
bt_iso_chan_set_state(chan, BT_ISO_BOUND);
778+
if (chan->conn->iso.is_bis) {
779+
bt_iso_chan_set_state(chan, BT_ISO_DISCONNECTED);
780+
} else {
781+
bt_iso_chan_set_state(chan, BT_ISO_BOUND);
779782

780-
/* Unbind if acting as slave or ACL has been disconnected */
781-
if (chan->conn->role == BT_HCI_ROLE_SLAVE ||
782-
chan->conn->iso.acl->state == BT_CONN_DISCONNECTED) {
783-
bt_iso_chan_unbind(chan);
783+
/* Unbind if acting as slave or ACL has been disconnected */
784+
if (chan->conn->role == BT_HCI_ROLE_SLAVE ||
785+
chan->conn->iso.acl->state == BT_CONN_DISCONNECTED) {
786+
bt_iso_chan_unbind(chan);
787+
}
784788
}
785789

786790
if (chan->ops->disconnected) {

0 commit comments

Comments
 (0)