From 92df6292cf3ea36dcb5155ce7a75d8787a255f7a Mon Sep 17 00:00:00 2001 From: Diff-fusion Date: Thu, 21 Nov 2024 09:25:48 +0100 Subject: [PATCH] Codrio BLE: ignore packet if data allocation fails (#384) --- .../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 7284df9cfa4..7db1994662e 100644 --- a/connectivity/FEATURE_BLE/source/cordio/stack_adaptation/hci_tr.c +++ b/connectivity/FEATURE_BLE/source/cordio/stack_adaptation/hci_tr.c @@ -245,7 +245,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; } }