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

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

Log when p_cb or p_cb->p_cback is NULL

If p_cb or p_cb->p_cback is NULL, bta_jv_port_mgmt_cl_cback returns
early.  Log when this happens.

Bug: 292143051
Test: m Bluetooth
Flag: EXEMPT logging change only
Change-Id: I739d0fa1026f43de3a87520a36caf9bb8fb53b09
parent 74293501
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1360,8 +1360,14 @@ static void bta_jv_port_mgmt_cl_cback(uint32_t code, uint16_t port_handle) {
  uint16_t lcid;
  tBTA_JV_RFCOMM_CBACK* p_cback; /* the callback function */

  log::verbose("code={}, port_handle={}", code, port_handle);
  if (NULL == p_cb || NULL == p_cb->p_cback) return;
  if (p_cb == NULL) {
    log::warn("p_cb is NULL, code={}, port_handle={}", code, port_handle);
    return;
  } else if (p_cb->p_cback == NULL) {
    log::warn("p_cb->p_cback is null, code={}, port_handle={}", code,
              port_handle);
    return;
  }

  log::verbose("code={}, port_handle={}, handle={}", code, port_handle,
               p_cb->handle);