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

Commit ab94ec2d authored by Huirong Liao's avatar 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_stack_l2cap pass

Change-Id: I1b2aafb3df65026d060c208a935b7c217e399c02
parent 922b7767
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -100,9 +100,13 @@ static void l2c_csm_indicate_connection_open(tL2C_CCB* p_ccb) {
  if (p_ccb->connection_initiator == L2CAP_INITIATOR_LOCAL) {
    (*p_ccb->p_rcb->api.pL2CA_ConnectCfm_Cb)(p_ccb->local_cid, L2CAP_CONN_OK);
  } else {
    if (*p_ccb->p_rcb->api.pL2CA_ConnectInd_Cb) {
      (*p_ccb->p_rcb->api.pL2CA_ConnectInd_Cb)(
          p_ccb->p_lcb->remote_bd_addr, p_ccb->local_cid, p_ccb->p_rcb->psm,
          p_ccb->remote_id);
    } else {
      LOG_WARN("pL2CA_ConnectInd_Cb is null");
    }
  }
  if (p_ccb->chnl_state == CST_OPEN && !p_ccb->p_lcb->is_transport_ble()) {
    (*p_ccb->p_rcb->api.pL2CA_ConfigCfm_Cb)(