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

Commit fa36ffd6 authored by Pomai Ahlo's avatar Pomai Ahlo
Browse files

btif_sock_rfc: log rfc_port_handle before crash

create_srv_accept_rfc_slot will crash if accept_rs and srv_rs get the
same port handle.  Log the port handle before the crash for better
debugging.

Bug: 330829481
Test: m Bluetooth
Flag: EXEMPT logging change only
Change-Id: Iff0872085cf2fbce8fcc7d6448e04baf5449d24d
parent 74293501
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -257,6 +257,12 @@ static rfc_slot_t* create_srv_accept_rfc_slot(rfc_slot_t* srv_rs,
  srv_rs->rfc_handle = new_listen_handle;
  srv_rs->rfc_port_handle = BTA_JvRfcommGetPortHdl(new_listen_handle);

  if (accept_rs->rfc_port_handle == srv_rs->rfc_port_handle) {
    log::error(
        "accept_rs->rfc_port_handle == srv_rs->rfc_port_handle, "
        "rfc_port_handle={}",
        accept_rs->rfc_port_handle);
  }
  log::assert_that(
      accept_rs->rfc_port_handle != srv_rs->rfc_port_handle,
      "assert failed: accept_rs->rfc_port_handle != srv_rs->rfc_port_handle");