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

Commit 384cc818 authored by Huirong Liao's avatar Huirong Liao Committed by huirong liao
Browse files

Fix L2CAP PTS issue

[Root Cause]
NE happens when run L2CAP/COS/CFC/BV-03-C.

[Solution]
Add NULL pointer judgment in code to avoid BT crash.

Bug: 249615821
Test: atest net_test_btif_stack pass

Change-Id: I1b2aafb3df65026d060c208a935b7c217e399c01
parent 9738f710
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -729,6 +729,11 @@ bool L2CA_ConnectCreditBasedRsp(const RawAddress& p_bd_addr, uint8_t id,
   */
  tL2C_CCB* p_ccb = l2cu_find_ccb_by_cid(p_lcb, p_lcb->pending_lead_cid);

  if (!p_ccb) {
    L2CAP_TRACE_ERROR("%s No CCB for CID:0x%04x", __func__, p_lcb->pending_lead_cid);
    return false;
  }

  for (uint16_t cid : accepted_lcids) {
    tL2C_CCB* temp_p_ccb = l2cu_find_ccb_by_cid(p_lcb, cid);
    if (temp_p_ccb == NULL) {