diff mbox series

[RFC,BlueZ,v2,03/11] shared/bap: bap_abort_stream_req() should cancel also current req

Message ID 4c8142e02e4b63d181e05baf7f0e849ec9a19b90.1746374514.git.pav@iki.fi
State New
Headers show
Series [RFC,BlueZ,v2,01/11] org.bluez.MediaEndpoint: removing BAP streams with ClearConfiguration | expand

Commit Message

Pauli Virtanen May 4, 2025, 4:01 p.m. UTC
After bap_abort_stream_req() no req callbacks for stream shall be
called, so it has to fail also the currently in-flight request.
---
 src/shared/bap.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/src/shared/bap.c b/src/shared/bap.c
index 2a08f3eea..976e3c0b1 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -1298,6 +1298,13 @@  static void bap_abort_stream_req(struct bt_bap *bap,
 						struct bt_bap_stream *stream)
 {
 	queue_remove_all(bap->reqs, match_req_stream, stream, bap_req_abort);
+
+	if (bap->req && bap->req->stream == stream) {
+		struct bt_bap_req *req = bap->req;
+
+		bap->req = NULL;
+		bap_req_complete(req, NULL);
+	}
 }
 
 static void bt_bap_stream_unref(void *data)