From 0b89230f5bea9eb0a0c3869bf2420eeff83d7745 Mon Sep 17 00:00:00 2001 From: Felix Date: Mon, 18 Nov 2024 17:11:13 +0100 Subject: [PATCH] Codrio BLE: ignore packet if data allocation fails --- .../FEATURE_BLE/source/cordio/stack_adaptation/hci_tr.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/connectivity/FEATURE_BLE/source/cordio/stack_adaptation/hci_tr.c b/connectivity/FEATURE_BLE/source/cordio/stack_adaptation/hci_tr.c index 7663276ec5b..7872f208496 100644 --- a/connectivity/FEATURE_BLE/source/cordio/stack_adaptation/hci_tr.c +++ b/connectivity/FEATURE_BLE/source/cordio/stack_adaptation/hci_tr.c @@ -239,7 +239,15 @@ void hciTrSerialRxIncoming(uint8_t *pBuf, uint8_t len) } else { + /** + * As above, simply employing WSF_ASSERT is not reasonable. + * Instead, it is advisable to discard this data packet, + * exit the packet processing function, + * and adjust the stateRx back to HCI_RX_STATE_IDLE. + */ + stateRx = HCI_RX_STATE_IDLE; WSF_ASSERT(0); /* allocate falied */ + return; } }