Bluetooth: controller: Fix unknown control PDU checks

Fix unknown control procedure handling to check transaction
violations.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
Vinayak Kariappa Chettimada 2021-03-12 12:09:08 +05:30 committed by Carles Cufí
commit ef9e429228

View file

@ -4334,13 +4334,14 @@ static inline bool ctrl_is_unexpected(struct ll_conn *conn, uint8_t opcode)
static int unknown_rsp_send(struct ll_conn *conn, struct node_rx_pdu *rx, static int unknown_rsp_send(struct ll_conn *conn, struct node_rx_pdu *rx,
uint8_t type) uint8_t type)
{ {
struct node_tx *tx;
struct pdu_data *pdu; struct pdu_data *pdu;
struct node_tx *tx;
int err;
/* acquire ctrl tx mem */ /* Check transaction violation and get free ctrl tx PDU */
tx = mem_acquire(&mem_conn_tx_ctrl.free); tx = ctrl_tx_rsp_mem_acquire(conn, rx, &err);
if (!tx) { if (!tx) {
return -ENOBUFS; return err;
} }
pdu = (void *)tx->pdu; pdu = (void *)tx->pdu;
@ -5511,6 +5512,7 @@ static inline void ctrl_tx_ack(struct ll_conn *conn, struct node_tx **tx,
break; break;
case PDU_DATA_LLCTRL_TYPE_FEATURE_RSP: case PDU_DATA_LLCTRL_TYPE_FEATURE_RSP:
case PDU_DATA_LLCTRL_TYPE_UNKNOWN_RSP:
/* Reset the transaction lock */ /* Reset the transaction lock */
conn->common.txn_lock = 0U; conn->common.txn_lock = 0U;
break; break;