From: Simon Mikuda <simon.mikuda@streamunlimited.com>
To: linux-bluetooth@vger.kernel.org
Cc: Simon Mikuda <simon.mikuda@gmail.com>
Subject: [PATCH BlueZ 3/4] bap: Don't leak the io of a PA sync that failed
Date: Sun, 22 Nov 2026 12:50:44 +0100 [thread overview]
Message-ID: <20261122115045.1077168-3-simon.mikuda@streamunlimited.com> (raw)
In-Reply-To: <20261122115045.1077168-1-simon.mikuda@streamunlimited.com>
From: Simon Mikuda <simon.mikuda@gmail.com>
The kernel reports a PA sync that times out twice.
iso_pa_sync_confirm_cb() replaced data->io_id for the second io, so the
watch of the first one stayed, holding the last reference of its io and
keeping the failed sync in the kernel. Where PA syncs are BIS
connections on BIG 0, a broadcast source on BIG 0 then fails to bind
with EADDRINUSE until bluetoothd restarts.
Remove the previous watch, which also closes its io.
Fixes: 2748c60a2c6b ("bap: Wait for BIG Info report event before creating streams")
Assisted-by: Claude:claude-opus-5-5
---
profiles/audio/bap.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index 457ba5de8..5e717cbef 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
@@ -1896,6 +1896,13 @@ static void iso_pa_sync_confirm_cb(GIOChannel *io, void *user_data)
* encryption flag is also available.
*/
DBG("PA Sync done");
+
+ /* A failed PA sync is reported twice. Dropping the previous watch also
+ * closes its io, as the watch holds the last reference.
+ */
+ if (data->io_id)
+ g_source_remove(data->io_id);
+
data->io_id = g_io_add_watch(io, G_IO_OUT, big_info_report_cb,
user_data);
}
--
2.43.0
next prev parent reply other threads:[~2026-11-22 11:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-22 11:50 [PATCH BlueZ 1/4] shared/bap: Remove broadcast sink PACs in bt_bap_remove_pac() Simon Mikuda
2026-11-22 11:50 ` [PATCH BlueZ 2/4] unit/test-bap: Check that a broadcast sink PAC can be removed Simon Mikuda
2026-11-22 11:50 ` Simon Mikuda [this message]
2026-11-22 11:50 ` [PATCH BlueZ 4/4] bap: Close a pending PA or BIG sync when a broadcast sink session ends Simon Mikuda
2026-11-22 19:01 ` [BlueZ,1/4] shared/bap: Remove broadcast sink PACs in bt_bap_remove_pac() bluez.test.bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261122115045.1077168-3-simon.mikuda@streamunlimited.com \
--to=simon.mikuda@streamunlimited.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=simon.mikuda@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox