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; } }