Skip to contentSkip to conversation

transport: Fix crash on Transport.Acquire

PATCH Applied Luiz Augusto von Dentz 3 participants 3 messages Jun 30, 2023 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 transport: Fix crash on Transport.Acquire

From: Luiz Augusto von Dentz <[email protected]>

This fixes crash introduced by 3030883 which caused requests not be initialized properly for A2DP.

---
 profiles/audio/transport.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
profiles/audio/transport.c +6 -5
index 48a40858b873..77216e10b3b3 100644
@@ -539,7 +539,7 @@ static DBusMessage *acquire(DBusConnection *conn, DBusMessage *msg,
 {
 	struct media_transport *transport = data;
 	struct media_owner *owner;
-	struct media_request *req;
+	struct media_request *req = NULL;
 	guint id;
 
 	if (transport->owner != NULL)
@@ -549,20 +549,21 @@ static DBusMessage *acquire(DBusConnection *conn, DBusMessage *msg,
 		return btd_error_not_authorized(msg);
 
 	owner = media_owner_create(msg);
-	if (bt_bap_stream_get_type(get_stream_bap(transport)) ==
-				BT_BAP_STREAM_TYPE_BCAST) {
+
+	if (!strcmp(media_endpoint_get_uuid(transport->endpoint),
+						BAA_SERVICE_UUID)) {
 		req = media_request_create(msg, 0x00);
 		media_owner_add(owner, req);
 		media_transport_set_owner(transport, owner);
 	}
+
 	id = transport->resume(transport, owner);
 	if (id == 0) {
 		media_owner_free(owner);
 		return btd_error_not_authorized(msg);
 	}
 
-	if (bt_bap_stream_get_type(get_stream_bap(transport)) ==
-				BT_BAP_STREAM_TYPE_UCAST) {
+	if (!req) {
 		req = media_request_create(msg, id);
 		media_owner_add(owner, req);
 		media_transport_set_owner(transport, owner);
Signature · 1 line
2.40.1
#1 lore raw

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=761667

---Test result---

Test Summary:

CheckPatch                    PASS      0.48 seconds
GitLint                       PASS      0.31 seconds
BuildEll                      PASS      32.05 seconds
BluezMake                     PASS      990.62 seconds
MakeCheck                     PASS      13.77 seconds
MakeDistcheck                 PASS      182.82 seconds
CheckValgrind                 PASS      303.36 seconds
CheckSmatch                   PASS      399.63 seconds
bluezmakeextell               PASS      122.17 seconds
IncrementalBuild              PASS      806.29 seconds
ScanBuild                     PASS      1232.68 seconds

---
Regards,
Linux Bluetooth

#2 lore raw
In reply to Luiz Augusto von Dentz
This patch was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This patch was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 8 lines · On Fri, 30 Jun 2023 12:26:42 -0700 you wrote:

From: Luiz Augusto von Dentz <[email protected]>

This fixes crash introduced by 3030883 which caused requests not be initialized properly for A2DP.

[...]

Here is the summary with links:
- [BlueZ] transport: Fix crash on Transport.Acquire

    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=19319bd3e22e

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html