Skip to content

Commit 92df629

Browse files
authored
Codrio BLE: ignore packet if data allocation fails (mbed-ce#384)
1 parent 784417f commit 92df629

File tree

1 file changed

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

1 file changed

+8
-0
lines changed

Diff for: connectivity/FEATURE_BLE/source/cordio/stack_adaptation/hci_tr.c

+8
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,15 @@ void hciTrSerialRxIncoming(uint8_t *pBuf, uint8_t len)
245245
}
246246
else
247247
{
248+
/**
249+
* As above, simply employing WSF_ASSERT is not reasonable.
250+
* Instead, it is advisable to discard this data packet,
251+
* exit the packet processing function,
252+
* and adjust the stateRx back to HCI_RX_STATE_IDLE.
253+
*/
254+
stateRx = HCI_RX_STATE_IDLE;
248255
WSF_ASSERT(0); /* allocate falied */
256+
return;
249257
}
250258

251259
}

0 commit comments

Comments
 (0)