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

Commit 86822bb4 authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

l2c: Fix invalid p_lcb usage

Tag: #feature
Bug: 159786353
Sponsor: jpawlowski@
Test: compile & manual testing
Change-Id: Ic667f4281986dd16038e332baef4f35005998a1c
parent 99d92c3d
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -781,7 +781,12 @@ std::vector<uint16_t> L2CA_ConnectCreditBasedReq(uint16_t psm,


  /* First, see if we already have a le link to the remote */
  /* First, see if we already have a le link to the remote */
  tL2C_LCB* p_lcb = l2cu_find_lcb_by_bd_addr(p_bd_addr, BT_TRANSPORT_LE);
  tL2C_LCB* p_lcb = l2cu_find_lcb_by_bd_addr(p_bd_addr, BT_TRANSPORT_LE);
  if (p_lcb == NULL || (p_lcb->link_state != LST_CONNECTED)) {
  if (p_lcb == NULL) {
    L2CAP_TRACE_WARNING("%s No link available", __func__);
    return allocated_cids;
  }

  if (p_lcb->link_state != LST_CONNECTED) {
    L2CAP_TRACE_WARNING("%s incorrect link state: %d", __func__,
    L2CAP_TRACE_WARNING("%s incorrect link state: %d", __func__,
                        p_lcb->link_state);
                        p_lcb->link_state);
    return allocated_cids;
    return allocated_cids;