Bluetooth: ISO: Fix BIG cleanup
Fix a regression for cleaning up BIGs added by
80c824f18ee80caa5bd162b9d2957dde1639add6 where the way
ISO connections were unref'ed was changed.
bt_iso_cleanup has been changed to only effect CIS
(as the unref from that has been removed), so instead
of calling bt_iso_cleanup we just call
bt_conn_unref directly.
This also removes some unref's from the BIG complete
and BIG Sync complete event handlers as the BIS bt_conns as
they don't increase the ref counter before anymore.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
diff --git a/subsys/bluetooth/host/iso.c b/subsys/bluetooth/host/iso.c
index 64df876..3d1ce90 100644
--- a/subsys/bluetooth/host/iso.c
+++ b/subsys/bluetooth/host/iso.c
@@ -1302,7 +1302,7 @@
struct bt_iso_chan *bis = big->bis[i];
if (bis->conn) {
- bt_iso_cleanup(bis->conn);
+ bt_conn_unref(bis->conn);
bis->conn = NULL;
}
}
@@ -1342,6 +1342,7 @@
bis->conn = iso_new();
if (!bis->conn) {
+ BT_ERR("Unable to allocate BIS connection");
return -ENOMEM;
}
@@ -1585,7 +1586,6 @@
bis->conn->handle = sys_le16_to_cpu(evt->handle[i]);
bt_conn_set_state(bis->conn, BT_CONN_CONNECTED);
- bt_conn_unref(bis->conn);
}
}
@@ -1645,7 +1645,6 @@
bis->conn->handle = bis_handle;
bt_conn_set_state(bis->conn, BT_CONN_CONNECTED);
- bt_conn_unref(bis->conn);
}
/* TODO: Deal with the rest of the fields in the event,