Skip to content

Commit b6dc79a

Browse files
committed
fix(ble/bluedroid): Fixed fail to disconnect when device record is cleared
1 parent ac38553 commit b6dc79a

File tree

1 file changed

+1
-2
lines changed
  • components/bt/host/bluedroid/stack/btm

1 file changed

+1
-2
lines changed

components/bt/host/bluedroid/stack/btm/btm_acl.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2519,8 +2519,7 @@ tBTM_STATUS btm_remove_acl (BD_ADDR bd_addr, tBT_TRANSPORT transport)
25192519
} else /* otherwise can disconnect right away */
25202520
#endif
25212521
{
2522-
if (hci_handle != 0xFFFF && p_dev_rec &&
2523-
p_dev_rec->sec_state != BTM_SEC_STATE_DISCONNECTING) {
2522+
if (hci_handle != 0xFFFF && (( p_dev_rec && p_dev_rec->sec_state != BTM_SEC_STATE_DISCONNECTING) || (!p_dev_rec))) {
25242523
if (!btsnd_hcic_disconnect (hci_handle, HCI_ERR_PEER_USER)) {
25252524
status = BTM_NO_RESOURCES;
25262525
}

0 commit comments

Comments
 (0)