From ec0277d8337041148c6d45ca35c2707a5ba77673 Mon Sep 17 00:00:00 2001 From: chenjianhua Date: Fri, 23 Aug 2024 16:31:12 +0800 Subject: [PATCH] fix(bt/bluedroid): Fixed work queue delete when create thread failed --- components/bt/common/osi/thread.c | 4 ++-- .../ble_50/ble50_security_client/main/ble50_sec_gattc_demo.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/bt/common/osi/thread.c b/components/bt/common/osi/thread.c index f53eadb665..91bc7906ce 100644 --- a/components/bt/common/osi/thread.c +++ b/components/bt/common/osi/thread.c @@ -271,10 +271,10 @@ _err: } for (int i = 0; i < thread->work_queue_num; i++) { - if (thread->work_queues[i]) { + if (thread->work_queues && thread->work_queues[i]) { osi_work_queue_delete(thread->work_queues[i]); + thread->work_queues[i] = NULL; } - thread->work_queues[i] = NULL; } if (thread->work_queues) { diff --git a/examples/bluetooth/bluedroid/ble_50/ble50_security_client/main/ble50_sec_gattc_demo.c b/examples/bluetooth/bluedroid/ble_50/ble50_security_client/main/ble50_sec_gattc_demo.c index bc6d94db36..dc80eeb7ca 100644 --- a/examples/bluetooth/bluedroid/ble_50/ble50_security_client/main/ble50_sec_gattc_demo.c +++ b/examples/bluetooth/bluedroid/ble_50/ble50_security_client/main/ble50_sec_gattc_demo.c @@ -430,7 +430,7 @@ static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *par } case ESP_GAP_BLE_EXT_SCAN_START_COMPLETE_EVT: if (param->ext_scan_start.status != ESP_BT_STATUS_SUCCESS) { - ESP_LOGE(GATTC_TAG, "scan start failed, error status = %x", param->scan_start_cmpl.status); + ESP_LOGE(GATTC_TAG, "scan start failed, error status = %x", param->ext_scan_start.status); break; } ESP_LOGI(GATTC_TAG, "Scan start success");