2023-06-30 19:29:22

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: [PATCH BlueZ] 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.

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

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);
--
2.40.1



2023-06-30 20:54:20

by bluez.test.bot

[permalink] [raw]
Subject: RE: [BlueZ] transport: Fix crash on Transport.Acquire

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

2023-06-30 21:22:49

by patchwork-bot+bluetooth

[permalink] [raw]
Subject: Re: [PATCH BlueZ] transport: Fix crash on Transport.Acquire

Hello:

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

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.
>
> 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!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html