From 4bf2eb3f4871776bca2490c8192c451e549ce4e2 Mon Sep 17 00:00:00 2001 From: zwj Date: Tue, 6 Sep 2022 21:12:30 +0800 Subject: [PATCH 1/2] fix calling esp_ble_get_cur_sendable_packets_num() sometimes crashes when bluetooth is disconnecting --- components/bt/host/bluedroid/stack/l2cap/l2c_api.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/components/bt/host/bluedroid/stack/l2cap/l2c_api.c b/components/bt/host/bluedroid/stack/l2cap/l2c_api.c index 0c64eedc27..2db8fd539d 100644 --- a/components/bt/host/bluedroid/stack/l2cap/l2c_api.c +++ b/components/bt/host/bluedroid/stack/l2cap/l2c_api.c @@ -2342,7 +2342,15 @@ void l2ble_update_att_acl_pkt_num(UINT8 type, tl2c_buff_param_t *param) xSemaphoreGive(buff_semaphore); break; } - fixed_queue_t * queue = p_lcb->p_fixed_ccbs[L2CAP_ATT_CID - L2CAP_FIRST_FIXED_CHNL]->xmit_hold_q; + + tL2C_CCB *p_ccb = p_lcb->p_fixed_ccbs[L2CAP_ATT_CID - L2CAP_FIRST_FIXED_CHNL]; + if(p_ccb == NULL) { + L2CAP_TRACE_ERROR("%s not found p_ccb", __func__); + xSemaphoreGive(buff_semaphore); + break; + } + + fixed_queue_t * queue = p_ccb->xmit_hold_q; att_max_num = MIN(p_lcb->link_xmit_quota, L2CAP_CACHE_ATT_ACL_NUM); if (queue == NULL){ L2CAP_TRACE_ERROR("%s not found queue", __func__); From c0c1485dc4d473c12d5534a289a8e526838d1ef8 Mon Sep 17 00:00:00 2001 From: zhiweijian Date: Tue, 23 Aug 2022 21:20:43 +0800 Subject: [PATCH 2/2] Add QA test Functions --- components/bt/controller/lib_esp32 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/controller/lib_esp32 b/components/bt/controller/lib_esp32 index c98341759b..d3a4f5bbc5 160000 --- a/components/bt/controller/lib_esp32 +++ b/components/bt/controller/lib_esp32 @@ -1 +1 @@ -Subproject commit c98341759b2c152c58878db6daf22d153a75fda4 +Subproject commit d3a4f5bbc58a9bb9f2398862606153c13a3f4e54