Skip to content

Commit 7204774

Browse files
Vudentzgregkh
authored andcommitted
Bluetooth: ISO: Don't initiate CIS connections if there are no buffers
[ Upstream commit d79c7d0 ] If the controller has no buffers left return -ENOBUFF to indicate that iso_cnt might be out of sync. Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 763d35d commit 7204774

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

net/bluetooth/iso.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,13 @@ static int iso_connect_cis(struct sock *sk)
460460
goto unlock;
461461
}
462462

463+
/* Check if there are available buffers for output/TX. */
464+
if (iso_pi(sk)->qos.ucast.out.sdu && !hci_iso_count(hdev) &&
465+
(hdev->iso_pkts && !hdev->iso_cnt)) {
466+
err = -ENOBUFS;
467+
goto unlock;
468+
}
469+
463470
/* Just bind if DEFER_SETUP has been set */
464471
if (test_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags)) {
465472
hcon = hci_bind_cis(hdev, &iso_pi(sk)->dst,

0 commit comments

Comments
 (0)