diff mbox series

[BlueZ,v2,7/8] transport: Fix crash when disable bcast stream

Message ID 20240201191016.1122194-7-luiz.dentz@gmail.com
State New
Headers show
Series [BlueZ,v2,1/8] client/mgmt: Add missing settings strings | expand

Commit Message

Luiz Augusto von Dentz Feb. 1, 2024, 7:10 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

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 mbox series

Patch

diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c
index 796017a4c6de..bd8960ef74fd 100644
--- a/profiles/audio/transport.c
+++ b/profiles/audio/transport.c
@@ -1532,7 +1532,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;
 	}