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

Commit 7071ae60 authored by Chris Manton's avatar Chris Manton Committed by Automerger Merge Worker
Browse files

btm_acl_removed: Check for null as acl may have already closed am: ed4c4715 am: 94112aaa

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1474376

Change-Id: I65b0d0eac23af259625385953e767dd93333e07e
parents ea4c4b9d 94112aaa
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 */