Skip to content

Commit

Permalink
Merge branch 'bugfix/delete_node_during_list_traverse_4.4' into 'rele…
Browse files Browse the repository at this point in the history
…ase/v4.4'

bugfix: Fixed the crash of LoadProhibited caused by invalid operation on list node in handling hci_hardware_error event (v4.4)

See merge request espressif/esp-idf!23118
  • Loading branch information
jack0c committed Apr 11, 2023
2 parents 43a38fc + 3a361bc commit 8e55945
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions components/bt/host/bluedroid/stack/btm/btm_acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,12 +509,14 @@ void btm_acl_device_down (void)
{
tACL_CONN *p = NULL;
BTM_TRACE_DEBUG ("btm_acl_device_down\n");
for (list_node_t *p_node = list_begin(btm_cb.p_acl_db_list); p_node; p_node = list_next(p_node)) {
p = list_node(p_node);
if (p && p->in_use) {
BTM_TRACE_DEBUG ("hci_handle=%d HCI_ERR_HW_FAILURE \n", p->hci_handle );
l2c_link_hci_disc_comp (p->hci_handle, HCI_ERR_HW_FAILURE);
}
for (list_node_t *p_node = list_begin(btm_cb.p_acl_db_list); p_node;) {
list_node_t *p_next = list_next(p_node);
p = list_node(p_node);
if (p && p->in_use) {
BTM_TRACE_DEBUG ("hci_handle=%d HCI_ERR_HW_FAILURE \n", p->hci_handle );
l2c_link_hci_disc_comp (p->hci_handle, HCI_ERR_HW_FAILURE);
}
p_node = p_next;
}
}
/*******************************************************************************
Expand Down

0 comments on commit 8e55945

Please sign in to comment.