Skip to content

Commit 0b89230

Browse files
committed
Codrio BLE: ignore packet if data allocation fails
1 parent cda8a9d commit 0b89230

File tree

1 file changed

+8
-0
lines changed
  • connectivity/FEATURE_BLE/source/cordio/stack_adaptation

1 file changed

+8
-0
lines changed

connectivity/FEATURE_BLE/source/cordio/stack_adaptation/hci_tr.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,15 @@ void hciTrSerialRxIncoming(uint8_t *pBuf, uint8_t len)
239239
}
240240
else
241241
{
242+
/**
243+
* As above, simply employing WSF_ASSERT is not reasonable.
244+
* Instead, it is advisable to discard this data packet,
245+
* exit the packet processing function,
246+
* and adjust the stateRx back to HCI_RX_STATE_IDLE.
247+
*/
248+
stateRx = HCI_RX_STATE_IDLE;
242249
WSF_ASSERT(0); /* allocate falied */
250+
return;
243251
}
244252

245253
}

0 commit comments

Comments
 (0)