fix(nimble): Fixed race condition happening with hci outstanding packets counter

This commit is contained in:
Sumeet Singh
2025-04-21 17:40:27 +05:30
committed by Rahul Tank
parent 1fdde6f555
commit f5136d2b35
+6 -4
View File
@@ -830,8 +830,14 @@ ble_hs_hci_acl_tx_now(struct ble_hs_conn *conn, struct os_mbuf **om)
BLE_HS_LOG(DEBUG, "\n");
#endif
/* Account for the controller buf that will hold the txed fragment. */
conn->bhc_outstanding_pkts++;
ble_hs_hci_avail_pkts--;
rc = ble_hs_tx_data(frag);
if (rc != 0) {
conn->bhc_outstanding_pkts--;
ble_hs_hci_avail_pkts++;
goto err;
}
@@ -840,10 +846,6 @@ ble_hs_hci_acl_tx_now(struct ble_hs_conn *conn, struct os_mbuf **om)
*/
conn->bhc_flags |= BLE_HS_CONN_F_TX_FRAG;
pb = BLE_HCI_PB_MIDDLE;
/* Account for the controller buf that will hold the txed fragment. */
conn->bhc_outstanding_pkts++;
ble_hs_hci_avail_pkts--;
}
if (txom != NULL) {