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

Commit 94112aaa 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

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

Change-Id: Ie35b346942e0cf5dd1ba4bdaea97c0ef649cb776
parents 79cfff53 ed4c4715
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 */