From c325347816a1a14da18da9183ab67dc62190b4a9 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Wed, 12 Oct 2022 19:29:30 +0530 Subject: [PATCH] Bluetooth: Controller: Fix missing node rx release on legacy CPR reject Legacy Control Procedure fix. Fix missing release of the node rx allocation that was reserved at the start of the LE Connection Parameter Request procedure and the procedure ends with reject indication transmitted to the initiating peer. Signed-off-by: Vinayak Kariappa Chettimada --- subsys/bluetooth/controller/ll_sw/ull_conn.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/subsys/bluetooth/controller/ll_sw/ull_conn.c b/subsys/bluetooth/controller/ll_sw/ull_conn.c index 6fdbb75b3b8..56fb77ba4e2 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_conn.c +++ b/subsys/bluetooth/controller/ll_sw/ull_conn.c @@ -3302,6 +3302,19 @@ static inline int event_conn_upd_prep(struct ll_conn *conn, uint16_t lazy, llctrl.conn_update_ind.win_offset); tx = CONTAINER_OF(pdu_ctrl_tx, struct node_tx, pdu); ctrl_tx_enqueue(conn, tx); + + /* Acquire the reserved Rx node */ + rx = conn->llcp_rx; + LL_ASSERT(rx && rx->hdr.link); + conn->llcp_rx = rx->hdr.link->mem; + + /* Mark for buffer for release */ + rx->hdr.type = NODE_RX_TYPE_RELEASE; + + /* enqueue rx node towards Thread */ + ll_rx_put(rx->hdr.link, rx); + ll_rx_sched(); + return -ECANCELED; #endif /* CONFIG_BT_CTLR_CONN_PARAM_REQ */