From 5ba5b3bc0bec0d2cc25e07c6c6a4f144db268124 Mon Sep 17 00:00:00 2001 From: Jin Cheng Date: Thu, 2 Jul 2026 19:51:06 +0800 Subject: [PATCH] fix(bt/bluedroid): fixed stuck sec_state on authention HCI command send failure Closes SEC-1164 --- components/bt/host/bluedroid/stack/btm/btm_sec.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/components/bt/host/bluedroid/stack/btm/btm_sec.c b/components/bt/host/bluedroid/stack/btm/btm_sec.c index 0399ec0bdd9..698037a82fc 100644 --- a/components/bt/host/bluedroid/stack/btm/btm_sec.c +++ b/components/bt/host/bluedroid/stack/btm/btm_sec.c @@ -5453,9 +5453,11 @@ static BOOLEAN btm_sec_start_get_name (tBTM_SEC_DEV_REC *p_dev_rec) *******************************************************************************/ static BOOLEAN btm_sec_start_authentication (tBTM_SEC_DEV_REC *p_dev_rec) { - p_dev_rec->sec_state = BTM_SEC_STATE_AUTHENTICATING; - - return (btsnd_hcic_auth_request (p_dev_rec->hci_handle)); + if (btsnd_hcic_auth_request (p_dev_rec->hci_handle)) { + p_dev_rec->sec_state = BTM_SEC_STATE_AUTHENTICATING; + return TRUE; + } + return FALSE; } /*******************************************************************************