public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/5] shared/bap: Fix not detaching streams when PAC is removed
@ 2023-01-26 20:12 Luiz Augusto von Dentz
  2023-01-26 20:12 ` [PATCH v3 2/5] bap: Fix not setting stream to NULL Luiz Augusto von Dentz
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Luiz Augusto von Dentz @ 2023-01-26 20:12 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

When local PAC is removed we attempt to release the streams but we left
it still attached to the endpoint, so this makes sure the stream is
properly detached by setting its state to idle.

Fixes: https://github.com/bluez/bluez/issues/457
---
 src/shared/bap.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/shared/bap.c b/src/shared/bap.c
index db7def7999b7..4ba65cbaa8f9 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -2478,8 +2478,10 @@ static void remove_streams(void *data, void *user_data)
 	struct bt_bap_stream *stream;
 
 	stream = queue_remove_if(bap->streams, match_stream_lpac, pac);
-	if (stream)
+	if (stream) {
 		bt_bap_stream_release(stream, NULL, NULL);
+		stream_set_state(stream, BT_BAP_STREAM_STATE_IDLE);
+	}
 }
 
 bool bt_bap_remove_pac(struct bt_bap_pac *pac)
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-01-27 20:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-26 20:12 [PATCH v3 1/5] shared/bap: Fix not detaching streams when PAC is removed Luiz Augusto von Dentz
2023-01-26 20:12 ` [PATCH v3 2/5] bap: Fix not setting stream to NULL Luiz Augusto von Dentz
2023-01-26 20:12 ` [PATCH v3 3/5] bap: Fix not removing endpoint if local PAC is unregistered Luiz Augusto von Dentz
2023-01-26 20:12 ` [PATCH v3 4/5] bap: Fix not checking if request fits when grouping Luiz Augusto von Dentz
2023-01-26 20:12 ` [PATCH v3 5/5] bap: Fix registering multiple endpoint for the same PAC set Luiz Augusto von Dentz
2023-01-26 22:26 ` [v3,1/5] shared/bap: Fix not detaching streams when PAC is removed bluez.test.bot
2023-01-27 20:10 ` [PATCH v3 1/5] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox