This is an automated email from the ASF dual-hosted git repository. janc pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
commit b74b97fd7da4aa308f8da48b45e11c2dda86731c Author: Szymon Janc <[email protected]> AuthorDate: Tue Mar 12 14:57:04 2024 +0100 nimble/eatt: Fix no resource handling on accept Return error code instead of asserting on low resources. --- nimble/host/src/ble_eatt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nimble/host/src/ble_eatt.c b/nimble/host/src/ble_eatt.c index 9fad2a862..721c94608 100644 --- a/nimble/host/src/ble_eatt.c +++ b/nimble/host/src/ble_eatt.c @@ -244,15 +244,17 @@ ble_eatt_l2cap_event_fn(struct ble_l2cap_event *event, void *arg) if (!eatt) { return BLE_HS_ENOMEM; } + eatt->conn_handle = event->accept.conn_handle; event->accept.chan->cb_arg = eatt; rc = ble_eatt_prepare_rx_sdu(event->accept.chan); if (rc) { ble_eatt_free(eatt); + return rc; } - assert(rc == 0); - return 0; + + break; case BLE_L2CAP_EVENT_COC_TX_UNSTALLED: ble_npl_eventq_put(ble_hs_evq_get(), &eatt->wakeup_ev); break;
