Skip to content

Commit 97b47f1

Browse files
committed
Merge branch 'bugfix/bluedroid_ble_provisioning_gatt_deregister_fix' into 'master'
Bluedroid: Fix BLE provisioning failure with bluedroid stack See merge request espressif/esp-idf!9833
2 parents 600665a + 70eb9ab commit 97b47f1

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

components/bt/host/bluedroid/stack/gatt/gatt_api.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,6 +1242,8 @@ void GATT_Deregister (tGATT_IF gatt_if)
12421242
tGATT_REG *p_reg = gatt_get_regcb(gatt_if);
12431243
tGATT_TCB *p_tcb;
12441244
tGATT_CLCB *p_clcb;
1245+
list_node_t *p_node = NULL;
1246+
list_node_t *p_next = NULL;
12451247
#if (GATTS_INCLUDED == TRUE)
12461248
UINT8 ii;
12471249
tGATT_SR_REG *p_sreg;
@@ -1268,9 +1270,9 @@ void GATT_Deregister (tGATT_IF gatt_if)
12681270
#endif ///GATTS_INCLUDED == TRUE
12691271
/* When an application deregisters, check remove the link associated with the app */
12701272

1271-
list_node_t *p_node = NULL;
1272-
for(p_node = list_begin(gatt_cb.p_tcb_list); p_node; p_node = list_next(p_node)) {
1273-
p_tcb = list_node(p_node);
1273+
for(p_node = list_begin(gatt_cb.p_tcb_list); p_node; p_node = p_next) {
1274+
p_tcb = list_node(p_node);
1275+
p_next = list_next(p_node);
12741276
if (p_tcb->in_use) {
12751277
if (gatt_get_ch_state(p_tcb) != GATT_CH_CLOSE) {
12761278
gatt_update_app_use_link_flag(gatt_if, p_tcb, FALSE, FALSE);
@@ -1280,9 +1282,11 @@ void GATT_Deregister (tGATT_IF gatt_if)
12801282
}
12811283
}
12821284

1283-
list_node_t *p_node = NULL;
1284-
for(p_node = list_begin(gatt_cb.p_clcb_list); p_node; p_node = list_next(p_node)) {
1285-
p_clcb = list_node(p_node);
1285+
list_node_t *p_node_clcb = NULL;
1286+
list_node_t *p_node_next = NULL;
1287+
for(p_node_clcb = list_begin(gatt_cb.p_clcb_list); p_node_clcb; p_node_clcb = p_node_next) {
1288+
p_clcb = list_node(p_node_clcb);
1289+
p_node_next = list_next(p_node_clcb);
12861290
if (p_clcb->in_use &&
12871291
(p_clcb->p_reg->gatt_if == gatt_if) &&
12881292
(p_clcb->p_tcb->tcb_idx == p_tcb->tcb_idx)) {

0 commit comments

Comments
 (0)