diff mbox series

[BlueZ] transport: Fix crash on Transport.Acquire

Message ID 20230630192642.3591626-1-luiz.dentz@gmail.com (mailing list archive)
State Accepted
Commit 19319bd3e22ed7945f118bc5faf62a6380070e4a
Headers show
Series [BlueZ] transport: Fix crash on Transport.Acquire | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/BuildEll success Build ELL PASS
tedd_an/BluezMake success Bluez Make PASS
tedd_an/MakeCheck success Bluez Make Check PASS
tedd_an/MakeDistcheck success Make Distcheck PASS
tedd_an/CheckValgrind success Check Valgrind PASS
tedd_an/CheckSmatch success CheckSparse PASS
tedd_an/bluezmakeextell success Make External ELL PASS
tedd_an/IncrementalBuild success Incremental Build PASS
tedd_an/ScanBuild success Scan Build PASS

Commit Message

Luiz Augusto von Dentz June 30, 2023, 7:26 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

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

Fixes: https://github.com/bluez/bluez/issues/542
---
 profiles/audio/transport.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Comments

bluez.test.bot@gmail.com June 30, 2023, 8:45 p.m. UTC | #1
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
patchwork-bot+bluetooth@kernel.org June 30, 2023, 9 p.m. UTC | #2
Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Fri, 30 Jun 2023 12:26:42 -0700 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> This fixes crash introduced by 3030883 which caused requests not be
> initialized properly for A2DP.
> 
> Fixes: https://github.com/bluez/bluez/issues/542
> 
> [...]

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

Patch

diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c
index 48a40858b873..77216e10b3b3 100644
--- a/profiles/audio/transport.c
+++ b/profiles/audio/transport.c
@@ -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);