Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed4c4715 authored by Chris Manton's avatar Chris Manton
Browse files

btm_acl_removed: Check for null as acl may have already closed

Bug:159815595
Tag: #refactor
Test: acts.py BleCocTest

Change-Id: I7a5312d4d929280de73442885100714264cd1457
parent 1de12568
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -470,15 +470,15 @@ void btm_acl_update_conn_addr(uint16_t conn_handle, const RawAddress& address) {
 ******************************************************************************/
void btm_acl_removed(uint16_t handle) {
  tACL_CONN* p_acl = internal_.acl_get_connection_from_handle(handle);
  if (p_acl == nullptr) {
    LOG_WARN("Unable to find active acl");
    return;
  }
  RawAddress bda = p_acl->remote_addr;
  tBT_TRANSPORT transport = p_acl->transport;
  if (transport == BT_TRANSPORT_LE) {
    bda = p_acl->conn_addr;
  }
  if (p_acl == nullptr) {
    LOG_WARN("Unable to find active acl");
    return;
  }
  p_acl->in_use = false;

  /* Only notify if link up has had a chance to be issued */