@@ -1242,6 +1242,8 @@ void GATT_Deregister (tGATT_IF gatt_if)
1242
1242
tGATT_REG * p_reg = gatt_get_regcb (gatt_if );
1243
1243
tGATT_TCB * p_tcb ;
1244
1244
tGATT_CLCB * p_clcb ;
1245
+ list_node_t * p_node = NULL ;
1246
+ list_node_t * p_next = NULL ;
1245
1247
#if (GATTS_INCLUDED == TRUE )
1246
1248
UINT8 ii ;
1247
1249
tGATT_SR_REG * p_sreg ;
@@ -1268,9 +1270,9 @@ void GATT_Deregister (tGATT_IF gatt_if)
1268
1270
#endif ///GATTS_INCLUDED == TRUE
1269
1271
/* When an application deregisters, check remove the link associated with the app */
1270
1272
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 );
1274
1276
if (p_tcb -> in_use ) {
1275
1277
if (gatt_get_ch_state (p_tcb ) != GATT_CH_CLOSE ) {
1276
1278
gatt_update_app_use_link_flag (gatt_if , p_tcb , FALSE, FALSE);
@@ -1280,9 +1282,11 @@ void GATT_Deregister (tGATT_IF gatt_if)
1280
1282
}
1281
1283
}
1282
1284
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 );
1286
1290
if (p_clcb -> in_use &&
1287
1291
(p_clcb -> p_reg -> gatt_if == gatt_if ) &&
1288
1292
(p_clcb -> p_tcb -> tcb_idx == p_tcb -> tcb_idx )) {
0 commit comments