mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 11:17:20 +02:00
fix(bt/bluedroid): Fixed crash after bluedroid deinit
hci_host_env.downstream_data_ready is set to NULL during bluedroid deinit, causing the controller to use a null pointer when calling callback.
This commit is contained in:
@ -140,6 +140,10 @@ void hci_shut_down(void)
|
|||||||
|
|
||||||
bool hci_downstream_data_post(uint32_t timeout)
|
bool hci_downstream_data_post(uint32_t timeout)
|
||||||
{
|
{
|
||||||
|
if (hci_host_env.downstream_data_ready == NULL) {
|
||||||
|
HCI_TRACE_WARNING("%s downstream_data_ready event not created", __func__);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return osi_thread_post_event(hci_host_env.downstream_data_ready, timeout);
|
return osi_thread_post_event(hci_host_env.downstream_data_ready, timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,7 +263,7 @@ static void transmit_command(
|
|||||||
// in case the upper layer didn't already
|
// in case the upper layer didn't already
|
||||||
command->event = MSG_STACK_TO_HC_HCI_CMD;
|
command->event = MSG_STACK_TO_HC_HCI_CMD;
|
||||||
|
|
||||||
HCI_TRACE_DEBUG("HCI Enqueue Comamnd opcode=0x%x\n", metadata->opcode);
|
HCI_TRACE_DEBUG("HCI Enqueue Command opcode=0x%x\n", metadata->opcode);
|
||||||
BTTRC_DUMP_BUFFER(NULL, command->data + command->offset, command->len);
|
BTTRC_DUMP_BUFFER(NULL, command->data + command->offset, command->len);
|
||||||
|
|
||||||
fixed_pkt_queue_enqueue(hci_host_env.command_queue, linked_pkt, FIXED_PKT_QUEUE_MAX_TIMEOUT);
|
fixed_pkt_queue_enqueue(hci_host_env.command_queue, linked_pkt, FIXED_PKT_QUEUE_MAX_TIMEOUT);
|
||||||
|
Reference in New Issue
Block a user