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

Commit 78119d5f authored by Pomai Ahlo's avatar Pomai Ahlo Committed by Gerrit Code Review
Browse files

Merge "l2c_link_check_send_pkts: Add null checks" into main

parents 05520f81 5b614fc4
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -900,7 +900,8 @@ void l2c_link_check_send_pkts(tL2C_LCB* p_lcb, uint16_t local_cid,
      }

      /* See if we can send anything from the Link Queue */
      if (!list_is_empty(p_lcb->link_xmit_data_q)) {
      if (p_lcb->link_xmit_data_q != NULL &&
          !list_is_empty(p_lcb->link_xmit_data_q)) {
        log::verbose("Sending to lower layer");
        p_buf = (BT_HDR*)list_front(p_lcb->link_xmit_data_q);
        list_remove(p_lcb->link_xmit_data_q, p_buf);
@@ -954,7 +955,8 @@ void l2c_link_check_send_pkts(tL2C_LCB* p_lcb, uint16_t local_cid,
            (l2cb.controller_le_xmit_window != 0 &&
             (p_lcb->transport == BT_TRANSPORT_LE))) &&
           (p_lcb->sent_not_acked < p_lcb->link_xmit_quota)) {
      if (list_is_empty(p_lcb->link_xmit_data_q)) {
      if ((p_lcb->link_xmit_data_q == NULL) ||
          list_is_empty(p_lcb->link_xmit_data_q)) {
        log::verbose("No transmit data, skipping");
        break;
      }
@@ -986,7 +988,8 @@ void l2c_link_check_send_pkts(tL2C_LCB* p_lcb, uint16_t local_cid,
    /* There is a special case where we have readjusted the link quotas and  */
    /* this link may have sent anything but some other link sent packets so  */
    /* so we may need a timer to kick off this link's transmissions.         */
    if ((!list_is_empty(p_lcb->link_xmit_data_q)) &&
    if ((p_lcb->link_xmit_data_q != NULL) &&
        (!list_is_empty(p_lcb->link_xmit_data_q)) &&
        (p_lcb->sent_not_acked < p_lcb->link_xmit_quota)) {
      alarm_set_on_mloop(p_lcb->l2c_lcb_timer,
                         L2CAP_LINK_FLOW_CONTROL_TIMEOUT_MS,