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

Commit 76716fb8 authored by Hui Peng's avatar Hui Peng
Browse files

[Invisalign2] Use btm_find_or_alloc_dev in btm_sec_connect_req

Bug: 301661850
Test: m com.android.btservices
Change-Id: I39ad73b83fdd4fa2eae840feb868fba7146cdd5a
parent 9af88688
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -2060,7 +2060,7 @@ tBTM_STATUS btm_sec_mx_access_request(const RawAddress& bd_addr,
 *
 ******************************************************************************/
void btm_sec_conn_req(const RawAddress& bda, uint8_t* dc) {
  tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bda);
  tBTM_SEC_DEV_REC* p_dev_rec = nullptr;

  /* Some device may request a connection before we are done with the HCI_Reset
   * sequence */
@@ -2086,10 +2086,7 @@ void btm_sec_conn_req(const RawAddress& bda, uint8_t* dc) {
  btm_sec_cb.connecting_bda = bda;
  memcpy(btm_sec_cb.connecting_dc, dc, DEV_CLASS_LEN);

  if (!p_dev_rec) {
    /* accept the connection -> allocate a device record */
    p_dev_rec = btm_sec_alloc_dev(bda);
  }
  p_dev_rec = btm_find_or_alloc_dev(bda);
  p_dev_rec->sm4 |= BTM_SM4_CONN_PEND;
}