From 62c1e1a52bcf317d5b27239d452d9801626aa8ee Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Thu, 20 Feb 2020 14:33:26 +0530 Subject: [PATCH] Bluetooth: controller: split: Fix assert on invalid packet sequence Fix to remove assertion failure check on detecting invalid packet sequence used by peer central and that no non-empty packet was transmitted. Fixes #22967. Signed-off-by: Vinayak Kariappa Chettimada --- .../controller/ll_sw/nordic/lll/lll_conn.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c index 8462b0198c0..53980ba9bab 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c @@ -658,6 +658,9 @@ static int isr_rx_pdu(struct lll_conn *lll, struct pdu_data *pdu_data_rx, { /* Ack for tx-ed data */ if (pdu_data_rx->nesn != lll->sn) { + struct node_tx *tx; + memq_link_t *link; + /* Increment serial number */ lll->sn++; @@ -671,14 +674,16 @@ static int isr_rx_pdu(struct lll_conn *lll, struct pdu_data *pdu_data_rx, #endif /* CONFIG_BT_PERIPHERAL */ if (!lll->empty) { - struct pdu_data *pdu_data_tx; - u8_t pdu_data_tx_len; - struct node_tx *tx; - memq_link_t *link; - link = memq_peek(lll->memq_tx.head, lll->memq_tx.tail, (void **)&tx); - LL_ASSERT(link); + } else { + lll->empty = 0; + link = NULL; + } + + if (link) { + struct pdu_data *pdu_data_tx; + u8_t pdu_data_tx_len; pdu_data_tx = (void *)(tx->pdu + lll->packet_tx_head_offset); @@ -710,8 +715,6 @@ static int isr_rx_pdu(struct lll_conn *lll, struct pdu_data *pdu_data_rx, *tx_release = tx; } - } else { - lll->empty = 0; } }