From 489e99c0917cd9829944cf8ac5388928ae0287a5 Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Thu, 22 Dec 2022 16:41:00 +0100 Subject: [PATCH] Bluetooth: ISO: Fix bad handle of data path error for broadcast The way that the braodcast clause for handling failing ISO data path would end up in the __ASSERT. It has been slightly modified to make it use if-else properly. Signed-off-by: Emil Gydesen --- subsys/bluetooth/host/iso.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/subsys/bluetooth/host/iso.c b/subsys/bluetooth/host/iso.c index c3ff5ee9df7..e27d8dfaac5 100644 --- a/subsys/bluetooth/host/iso.c +++ b/subsys/bluetooth/host/iso.c @@ -368,10 +368,11 @@ void bt_iso_connected(struct bt_conn *iso) err = bt_iso_setup_data_path(chan); if (err != 0) { - LOG_ERR("Unable to setup data path: %d", err); + if (false) { + #if defined(CONFIG_BT_ISO_BROADCAST) - if (iso->iso.info.type == BT_ISO_CHAN_TYPE_BROADCASTER || - iso->iso.info.type == BT_ISO_CHAN_TYPE_SYNC_RECEIVER) { + } else if (iso->iso.info.type == BT_ISO_CHAN_TYPE_BROADCASTER || + iso->iso.info.type == BT_ISO_CHAN_TYPE_SYNC_RECEIVER) { struct bt_iso_big *big; int err; @@ -381,9 +382,9 @@ void bt_iso_connected(struct bt_conn *iso) if (err != 0) { LOG_ERR("Could not terminate BIG: %d", err); } - } #endif /* CONFIG_BT_ISO_BROADCAST */ - if (IS_ENABLED(CONFIG_BT_ISO_UNICAST) && + + } else if (IS_ENABLED(CONFIG_BT_ISO_UNICAST) && iso->iso.info.type == BT_ISO_CHAN_TYPE_CONNECTED) { bt_conn_disconnect(iso, BT_HCI_ERR_REMOTE_USER_TERM_CONN);