Bluetooth: controller: legacy: Fix regression handling tx pool corruption

Fix regression in handling tx pool corruption in relation to
commit 7a3e29af06 ("Bluetooth: controller: legacy: Fix Tx
pool corruption").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
Vinayak Kariappa Chettimada 2020-03-17 12:27:28 +05:30 committed by Carles Cufí
commit 6a37dc5a68

View file

@ -3788,6 +3788,7 @@ isr_rx_conn_pkt(struct radio_pdu_node_rx *node_rx,
if (node_tx) {
u8_t pdu_data_tx_len;
u8_t offset;
pdu_data_tx = (void *)(node_tx->pdu_data +
_radio.conn_curr->packet_tx_head_offset);
@ -3806,10 +3807,13 @@ isr_rx_conn_pkt(struct radio_pdu_node_rx *node_rx,
}
}
_radio.conn_curr->packet_tx_head_offset +=
pdu_data_tx_len;
if (_radio.conn_curr->packet_tx_head_offset ==
_radio.conn_curr->packet_tx_head_len) {
offset = _radio.conn_curr->packet_tx_head_offset +
pdu_data_tx_len;
if (offset < _radio.conn_curr->packet_tx_head_len) {
_radio.conn_curr->packet_tx_head_offset =
offset;
} else if (offset ==
_radio.conn_curr->packet_tx_head_len) {
*tx_release = isr_rx_conn_pkt_release(node_tx);
}
}