summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--profiles/audio/bap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index ae944b617..8f2411768 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
@@ -998,9 +998,10 @@ static void bap_state(struct bt_bap_stream *stream, uint8_t old_state,
switch (new_state) {
case BT_BAP_STREAM_STATE_IDLE:
/* Release stream if idle */
- if (ep)
+ if (ep) {
bap_io_close(ep);
- else
+ ep->stream = NULL;
+ } else
queue_remove(data->streams, stream);
break;
case BT_BAP_STREAM_STATE_CONFIG: