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

Commit 1ef40e98 authored by Bailey Forrest's avatar Bailey Forrest Committed by android-build-merger
Browse files

Merge "btm_sec_disconnected Check if p_dev_rec is still in scope" am: 2c9b6031 am: b82e91a2

am: 28294e1f

Change-Id: I3d1863437c80321d5484dd1e22fd969a009f92cc
parents 3a8d0847 28294e1f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -4480,6 +4480,13 @@ void btm_sec_disconnected(uint16_t handle, uint8_t reason) {
      (*btm_cb.api.p_auth_complete_callback)(p_dev_rec->bd_addr,
                                             p_dev_rec->dev_class,
                                             p_dev_rec->sec_bd_name, result);

      // |btm_cb.api.p_auth_complete_callback| may cause |p_dev_rec| to be
      // deallocated.
      p_dev_rec = btm_find_dev_by_handle(handle);
      if (!p_dev_rec) {
        return;
      }
    }
  }