Bluetooth: controller: split: Fix assert in PDU Rx quota increment

Directed advertising timeout released PDU Rx quota which it
should not be.

Relates to assert in #21006.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
Vinayak Kariappa Chettimada 2019-12-26 16:31:07 +05:30 committed by Alberto Escolar
commit 13a3270096

View file

@ -705,12 +705,21 @@ void ll_rx_mem_release(void **node_rx)
switch (rx_free->type) { switch (rx_free->type) {
#if defined(CONFIG_BT_CONN) #if defined(CONFIG_BT_CONN)
case NODE_RX_TYPE_CONNECTION: case NODE_RX_TYPE_CONNECTION:
#if defined(CONFIG_BT_CENTRAL)
{ {
struct node_rx_pdu *rx = (void *)rx_free; struct node_rx_cc *cc =
(void *)((struct node_rx_pdu *)rx_free)->pdu;
if (*((u8_t *)rx->pdu) == if (0) {
BT_HCI_ERR_UNKNOWN_CONN_ID) {
#if defined(CONFIG_BT_PERIPHERAL)
} else if (cc->status == BT_HCI_ERR_ADV_TIMEOUT) {
mem_release(rx_free, &mem_pdu_rx.free);
break;
#endif /* !CONFIG_BT_PERIPHERAL */
#if defined(CONFIG_BT_CENTRAL)
} else if (cc->status == BT_HCI_ERR_UNKNOWN_CONN_ID) {
struct lll_conn *conn_lll; struct lll_conn *conn_lll;
struct ll_scan_set *scan; struct ll_scan_set *scan;
struct ll_conn *conn; struct ll_conn *conn;
@ -737,15 +746,19 @@ void ll_rx_mem_release(void **node_rx)
#if defined(CONFIG_BT_CTLR_PRIVACY) #if defined(CONFIG_BT_CTLR_PRIVACY)
#if defined(CONFIG_BT_BROADCASTER) #if defined(CONFIG_BT_BROADCASTER)
if (!ull_adv_is_enabled_get(0)) if (!ull_adv_is_enabled_get(0))
#endif #endif /* CONFIG_BT_BROADCASTER */
{ {
ull_filter_adv_scan_state_cb(0); ull_filter_adv_scan_state_cb(0);
} }
#endif #endif /* CONFIG_BT_CTLR_PRIVACY */
break; break;
#endif /* CONFIG_BT_CENTRAL */
} else {
LL_ASSERT(!cc->status);
} }
} }
#endif /* CONFIG_BT_CENTRAL */
/* passthrough */ /* passthrough */
case NODE_RX_TYPE_DC_PDU: case NODE_RX_TYPE_DC_PDU:
#endif /* CONFIG_BT_CONN */ #endif /* CONFIG_BT_CONN */