From 8527a218d9b536c7845084d963fe83c205782af2 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Thu, 1 Feb 2024 13:58:14 -0500 Subject: [PATCH] transport: Fix crash when disable bcast stream bt_bap_stream_disable does cause the stream to go to releasing state removing the owner in the process so calling bap_disable_complete passing the existing owner would likely cause a crash. --- profiles/audio/transport.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c index b3c087d43..159fbd575 100644 --- a/profiles/audio/transport.c +++ b/profiles/audio/transport.c @@ -1539,7 +1539,8 @@ static guint transport_bap_suspend(struct media_transport *transport, id = bt_bap_stream_disable(bap->stream, bap->linked, func, owner); if (bt_bap_stream_get_type(bap->stream) == BT_BAP_STREAM_TYPE_BCAST) { - bap_disable_complete(bap->stream, 0x00, 0x00, owner); + if (transport->owner == owner) + bap_disable_complete(bap->stream, 0x00, 0x00, owner); return 0; } -- 2.47.3