The "Vendor" field is optional, and should have an initialized valid
default value.
---
profiles/audio/media.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/profiles/audio/media.c b/profiles/audio/media.c
index d96367454..a62755f69 100644
--- a/profiles/audio/media.c
+++ b/profiles/audio/media.c
@@ -2551,7 +2551,7 @@ static void app_register_endpoint(void *data, void *user_data)
const char *uuid;
gboolean delay_reporting = FALSE;
uint8_t codec;
- struct vendor vendor;
+ struct vendor vendor = { 0 };
struct bt_bap_pac_qos qos;
uint8_t *capabilities = NULL;
int size = 0;
--
2.39.1
Hi Pauli,
On Wed, Feb 1, 2023 at 10:57 AM Pauli Virtanen <[email protected]> wrote:
>
> The "Vendor" field is optional, and should have an initialized valid
> default value.
It is probably a good idea to include logs where the problem is detected.
> ---
> profiles/audio/media.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/profiles/audio/media.c b/profiles/audio/media.c
> index d96367454..a62755f69 100644
> --- a/profiles/audio/media.c
> +++ b/profiles/audio/media.c
> @@ -2551,7 +2551,7 @@ static void app_register_endpoint(void *data, void *user_data)
> const char *uuid;
> gboolean delay_reporting = FALSE;
> uint8_t codec;
> - struct vendor vendor;
> + struct vendor vendor = { 0 };
I guess {}; or { 0,0 }; are clearer here since there are 2 fields in
the struct, although it is probably safer to go with memset(&vendor,
0, sizeof(vendor)).
> struct bt_bap_pac_qos qos;
> uint8_t *capabilities = NULL;
> int size = 0;
> --
> 2.39.1
>
--
Luiz Augusto von Dentz
The "Vendor" field is optional, and should have an initialized valid
default value.
It has the default values in register_endpoint, but not in
app_register_endpoint, so make the latter match the former.
---
Notes:
v2: Let's not use C99 initializers.
The uninitialized values cause Pipewire media endpoint registrations to
fail, and this makes it work again. Its BAP media endpoints do not have
the Vendor field, given that they use LC3, so the struct in
app_register_endpoint ends up containing random garbage. The resulting
invalid codec/cid/vid value combination is rejected by
bt_bap_add_vendor_pac.
profiles/audio/media.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/profiles/audio/media.c b/profiles/audio/media.c
index d96367454..8a2afd04c 100644
--- a/profiles/audio/media.c
+++ b/profiles/audio/media.c
@@ -2583,6 +2583,8 @@ static void app_register_endpoint(void *data, void *user_data)
dbus_message_iter_get_basic(&iter, &codec);
+ memset(&vendor, 0, sizeof(vendor));
+
if (g_dbus_proxy_get_property(proxy, "Vendor", &iter)) {
if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_UINT32)
goto fail;
--
2.39.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=717858
---Test result---
Test Summary:
CheckPatch PASS 0.50 seconds
GitLint PASS 0.25 seconds
BuildEll PASS 26.98 seconds
BluezMake PASS 749.00 seconds
MakeCheck PASS 11.59 seconds
MakeDistcheck PASS 147.49 seconds
CheckValgrind PASS 238.95 seconds
CheckSmatch PASS 317.56 seconds
bluezmakeextell PASS 95.51 seconds
IncrementalBuild PASS 610.03 seconds
ScanBuild PASS 966.48 seconds
---
Regards,
Linux Bluetooth
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=717874
---Test result---
Test Summary:
CheckPatch PASS 1.01 seconds
GitLint FAIL 0.67 seconds
BuildEll PASS 28.44 seconds
BluezMake PASS 860.68 seconds
MakeCheck PASS 11.86 seconds
MakeDistcheck PASS 148.18 seconds
CheckValgrind PASS 244.17 seconds
CheckSmatch PASS 325.68 seconds
bluezmakeextell PASS 97.45 seconds
IncrementalBuild PASS 703.79 seconds
ScanBuild PASS 1001.52 seconds
Details
##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
[BlueZ,v2] media: set default value for BAP endpoint Vendor field
WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search
12: B2 Line has trailing whitespace: " "
---
Regards,
Linux Bluetooth
Hello:
This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <[email protected]>:
On Wed, 1 Feb 2023 19:51:47 +0000 you wrote:
> The "Vendor" field is optional, and should have an initialized valid
> default value.
>
> It has the default values in register_endpoint, but not in
> app_register_endpoint, so make the latter match the former.
> ---
>
> [...]
Here is the summary with links:
- [BlueZ,v2] media: set default value for BAP endpoint Vendor field
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=67395a3b357d
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html