Skip to content

Commit

Permalink
Bluetooth: hci_conn: Fix not restoring ISO buffer count on disconnect
Browse files Browse the repository at this point in the history
When disconnecting an ISO link the controller may not generate
HCI_EV_NUM_COMP_PKTS for unacked packets which needs to be restored in
hci_conn_del otherwise the host would assume they are still in use and
would not be able to use all the buffers available.

Fixes: 26afbd8 ("Bluetooth: Add initial implementation of CIS connections")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tested-by: Frédéric Danis <frederic.danis@collabora.com>
  • Loading branch information
Vudentz committed Nov 2, 2022
1 parent 7c9524d commit 5638d9e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions net/bluetooth/hci_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1067,10 +1067,21 @@ int hci_conn_del(struct hci_conn *conn)
hdev->acl_cnt += conn->sent;
} else {
struct hci_conn *acl = conn->link;

if (acl) {
acl->link = NULL;
hci_conn_drop(acl);
}

/* Unacked ISO frames */
if (conn->type == ISO_LINK) {
if (hdev->iso_pkts)
hdev->iso_cnt += conn->sent;
else if (hdev->le_pkts)
hdev->le_cnt += conn->sent;
else
hdev->acl_cnt += conn->sent;
}
}

if (conn->amp_mgr)
Expand Down

0 comments on commit 5638d9e

Please sign in to comment.