From d0c19a0e7478ab5de6ef8ecf53c5aa19cb516673 Mon Sep 17 00:00:00 2001 From: xiongweichao Date: Tue, 30 Aug 2022 17:49:35 +0800 Subject: [PATCH] Fixed deadlock due to wrong parameter when calling btc_transfer_context() after calling esp_bluedroid_disable() Closes https://github.com/espressif/esp-idf/issues/9672 --- components/bt/host/bluedroid/btc/core/btc_dm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/bt/host/bluedroid/btc/core/btc_dm.c b/components/bt/host/bluedroid/btc/core/btc_dm.c index 28cdcc2df1..90af714c1b 100644 --- a/components/bt/host/bluedroid/btc/core/btc_dm.c +++ b/components/bt/host/bluedroid/btc/core/btc_dm.c @@ -112,7 +112,8 @@ void btc_dm_sec_evt(tBTA_DM_SEC_EVT event, tBTA_DM_SEC *data) msg.pid = BTC_PID_DM_SEC; msg.act = event; - btc_transfer_context(&msg, (btc_dm_sec_args_t *)data, sizeof(btc_dm_sec_args_t), btc_dm_sec_arg_deep_copy); + btc_transfer_context(&msg, (btc_dm_sec_args_t *)data, + data == NULL ? 0 : sizeof(btc_dm_sec_args_t), btc_dm_sec_arg_deep_copy); } static void btc_enable_bluetooth_evt(tBTA_STATUS status)