All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] shared/bap: fix keeping PAC caps <-> metadata correspondence
@ 2025-11-09 12:32 Pauli Virtanen
  2025-11-09 14:02 ` [BlueZ] " bluez.test.bot
  2025-11-10 20:20 ` [PATCH BlueZ] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Pauli Virtanen @ 2025-11-09 12:32 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Pauli Virtanen

In PACS, Metadata is associated with a specific PAC.  bap_pac_merge()
mixes up metadatas from different PACs if some PAC has no metadata.

Fix caps<->metadata correspondence by explicitly storing 0-length entry,
instead of skipping it altogether, if metadata (or caps) is missing.
---
 src/shared/bap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/shared/bap.c b/src/shared/bap.c
index 427d18627..a18f393f7 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -3840,11 +3840,11 @@ static void *ltv_merge(struct iovec *data, struct iovec *cont)
 	if (!data)
 		return NULL;
 
+	util_iov_append(data, &delimiter, sizeof(delimiter));
+
 	if (!cont || !cont->iov_len || !cont->iov_base)
 		return data->iov_base;
 
-	util_iov_append(data, &delimiter, sizeof(delimiter));
-
 	return util_iov_append(data, cont->iov_base, cont->iov_len);
 }
 
-- 
2.51.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-11-10 20:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-09 12:32 [PATCH BlueZ] shared/bap: fix keeping PAC caps <-> metadata correspondence Pauli Virtanen
2025-11-09 14:02 ` [BlueZ] " bluez.test.bot
2025-11-10 20:20 ` [PATCH BlueZ] " patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.