Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ] shared/vcp: Fix duplicate VCS registration in bt_vcp_add_db
@ 2026-06-09 18:13 Simon Mikuda
  2026-06-09 19:32 ` [BlueZ] " bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Mikuda @ 2026-06-09 18:13 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Simon Mikuda

bt_vcp_add_db() called vcp_db_new() unconditionally, registering a
second VCS instance when bt_vcp_new() (e.g. a remote client session)
had already created a vdb for the same gatt_db. Guard the db as
bt_tmap_add_db()/bt_gmap_add_db() do, since VCS permits only one
instance per device.

Fixes PTS test VCS/SR/SGGIT/SER/BV-01-C.
---
 src/shared/vcp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/shared/vcp.c b/src/shared/vcp.c
index c7f74956e..f05684cfb 100644
--- a/src/shared/vcp.c
+++ b/src/shared/vcp.c
@@ -1939,6 +1939,9 @@ static struct bt_vcp_db *vcp_get_db(struct gatt_db *db)
 
 void bt_vcp_add_db(struct gatt_db *db)
 {
+	if (!db || queue_find(vcp_db, vcp_db_match, db))
+		return;
+
 	vcp_db_new(db);
 }
 
-- 
2.43.0


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

end of thread, other threads:[~2026-06-09 19:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-09 18:13 [PATCH BlueZ] shared/vcp: Fix duplicate VCS registration in bt_vcp_add_db Simon Mikuda
2026-06-09 19:32 ` [BlueZ] " bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox