l2cap: use remove channel from linked list without iterator

This commit is contained in:
Matthias Ringwald 2020-01-13 16:40:43 +01:00
parent 75e67d8a2b
commit 817374d931

View File

@ -1578,7 +1578,7 @@ static void l2cap_run(void){
channel->state = L2CAP_STATE_INVALID; channel->state = L2CAP_STATE_INVALID;
l2cap_send_signaling_packet(channel->con_handle, CONNECTION_RESPONSE, channel->remote_sig_id, channel->local_cid, channel->remote_cid, channel->reason, 0); l2cap_send_signaling_packet(channel->con_handle, CONNECTION_RESPONSE, channel->remote_sig_id, channel->local_cid, channel->remote_cid, channel->reason, 0);
// discard channel - l2cap_finialize_channel_close without sending l2cap close event // discard channel - l2cap_finialize_channel_close without sending l2cap close event
btstack_linked_list_iterator_remove(&it); btstack_linked_list_remove(&l2cap_channels, (btstack_linked_item_t *) channel);
l2cap_free_channel_entry(channel); l2cap_free_channel_entry(channel);
channel = NULL; channel = NULL;
break; break;