From 093d00b47ee4e3544aa80de33e869a8617c4af32 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 8 Dec 2023 16:34:54 -0500 Subject: [PATCH] bap: Don't attempt to release if old state was releasing If the old state was releasing there is no reason to call bt_bap_stream_release yet again when IO could not be created as that will likely create a loop situation when the remote stack caches the codec configuration. --- profiles/audio/bap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index c279b5b0e..c53079991 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -1918,7 +1918,9 @@ static void bap_state(struct bt_bap_stream *stream, uint8_t old_state, bap_create_io(data, ep, stream, true); if (!ep->io) { error("Unable to create io"); - bt_bap_stream_release(stream, NULL, NULL); + if (old_state != BT_BAP_STREAM_STATE_RELEASING) + bt_bap_stream_release(stream, NULL, + NULL); return; } -- 2.47.3