diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2025-06-27 11:18:29 -0400 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2025-09-27 11:37:00 -0400 |
commit | d79c7d01f1c8bcf9a48337c8960d618fbe31fc0c (patch) | |
tree | 0c9c734f86c84d232cbf616ceaa00ccdb566b570 | |
parent | 8183c8ea8762b1de6d2e32f36531d6ea81878f11 (diff) |
Bluetooth: ISO: Don't initiate CIS connections if there are no buffers
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>
-rw-r--r-- | net/bluetooth/iso.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c index 5ce823ca3aaf..ac6e83313b9b 100644 --- a/net/bluetooth/iso.c +++ b/net/bluetooth/iso.c @@ -458,6 +458,13 @@ static int iso_connect_cis(struct sock *sk) goto unlock; } + /* Check if there are available buffers for output/TX. */ + if (iso_pi(sk)->qos.ucast.out.sdu && !hci_iso_count(hdev) && + (hdev->iso_pkts && !hdev->iso_cnt)) { + err = -ENOBUFS; + goto unlock; + } + /* Just bind if DEFER_SETUP has been set */ if (test_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags)) { hcon = hci_bind_cis(hdev, &iso_pi(sk)->dst, |