Skip to content

Commit d3e3f8d

Browse files
wopu-otaescolar
authored andcommitted
Bluetooth: controller: split: Move invalidation of connection handle
Move invalidation of connection handle when flushing TX buffers into LLL context. Otherwise, LLL may or may not see invalidated handle depending on mayfly scheduling. Signed-off-by: Wolfgang Puffitsch <[email protected]>
1 parent a2ddf99 commit d3e3f8d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

subsys/bluetooth/controller/ll_sw/ull_conn.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,9 +1714,6 @@ static void conn_cleanup(struct ll_conn *conn, u8_t reason)
17141714
LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
17151715
(ticker_status == TICKER_STATUS_BUSY));
17161716

1717-
/* Invalidate the connection context */
1718-
lll->handle = 0xFFFF;
1719-
17201717
/* Demux and flush Tx PDUs that remain enqueued in thread context */
17211718
ull_conn_tx_demux(UINT8_MAX);
17221719
}
@@ -1746,6 +1743,9 @@ static void tx_lll_flush(void *param)
17461743

17471744
lll_conn_flush(lll);
17481745

1746+
/* Invalidate the connection context */
1747+
lll->handle = 0xFFFF;
1748+
17491749
link = memq_dequeue(lll->memq_tx.tail, &lll->memq_tx.head,
17501750
(void **)&tx);
17511751
while (link) {

0 commit comments

Comments
 (0)