Skip to content

Commit 6eb998b

Browse files
cvinayaknashif
authored andcommitted
Bluetooth: controller: Fix ping procedure checks
Fix ping procedure to check transaction violations. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent 26e335c commit 6eb998b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

subsys/bluetooth/controller/ll_sw/ull_conn.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5125,13 +5125,14 @@ static inline int length_req_rsp_recv(struct ll_conn *conn, memq_link_t *link,
51255125
#if defined(CONFIG_BT_CTLR_LE_PING)
51265126
static int ping_resp_send(struct ll_conn *conn, struct node_rx_pdu *rx)
51275127
{
5128-
struct node_tx *tx;
51295128
struct pdu_data *pdu_tx;
5129+
struct node_tx *tx;
5130+
int err;
51305131

5131-
/* acquire tx mem */
5132-
tx = mem_acquire(&mem_conn_tx_ctrl.free);
5132+
/* Check transaction violation and get free ctrl tx PDU */
5133+
tx = ctrl_tx_rsp_mem_acquire(conn, rx, &err);
51335134
if (!tx) {
5134-
return -ENOBUFS;
5135+
return err;
51355136
}
51365137

51375138
pdu_tx = (void *)tx->pdu;
@@ -5362,6 +5363,7 @@ static inline void ctrl_tx_ack(struct ll_conn *conn, struct node_tx **tx,
53625363
break;
53635364

53645365
case PDU_DATA_LLCTRL_TYPE_FEATURE_RSP:
5366+
case PDU_DATA_LLCTRL_TYPE_PING_RSP:
53655367
case PDU_DATA_LLCTRL_TYPE_UNKNOWN_RSP:
53665368
/* Reset the transaction lock */
53675369
conn->common.txn_lock = 0U;

0 commit comments

Comments
 (0)