Commit 437bfa5b authored by Vinayak Kariappa Chettimada's avatar Vinayak Kariappa Chettimada Committed by Mahesh Mahadevan
Browse files

Bluetooth: Controller: Infinite loop assertion on node_rx release



Add assertion check to catch infinite loop due to incorrect
node_rx release.

If same node_rx is released twice then it can lead to
infinite looping when releaseing link or node_rx buffers.

Signed-off-by: default avatarVinayak Kariappa Chettimada <vich@nordicsemi.no>
parent 86af9c4b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1053,6 +1053,7 @@ void ll_rx_dequeue(void)
	{
		struct node_rx_pdu *rx_curr;
		struct pdu_adv *adv;
		uint8_t loop = PDU_RX_POOL_SIZE / PDU_RX_NODE_POOL_ELEMENT_SIZE;

		adv = (struct pdu_adv *)rx->pdu;
		if (adv->type != PDU_ADV_TYPE_EXT_IND) {
@@ -1063,6 +1064,9 @@ void ll_rx_dequeue(void)
		while (rx_curr) {
			memq_link_t *link_free;

			LL_ASSERT(loop);
			loop--;

			link_free = rx_curr->hdr.link;
			rx_curr = rx_curr->rx_ftr.extra;