BT_ASCS_ASE_STATE_RELEASING has the same value as BT_BAP_STREAM_STATE_RELEASING, so a guard must be placed here. Until now the RELEASING state was not used for broadcast sinks, so this was not an issue. --- src/shared/bap.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/shared/bap.c b/src/shared/bap.c index 72f0f8a03..c69c9bf6c 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -2098,8 +2098,10 @@ static void bap_bcast_set_state(struct bt_bap_stream *stream, uint8_t state) stream->ops->detach(stream); break; case BT_ASCS_ASE_STATE_RELEASING: - bap_stream_io_detach(stream); - stream_set_state(stream, BT_BAP_STREAM_STATE_IDLE); + if (bt_bap_stream_io_dir(stream) == BT_BAP_BCAST_SINK) { + bap_stream_io_detach(stream); + stream_set_state(stream, BT_BAP_STREAM_STATE_IDLE); + } break; } } -- 2.40.1