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

Commit 990bebbd authored by Bhakthavatsala Raghavendra's avatar Bhakthavatsala Raghavendra Committed by Gerrit Code Review
Browse files

Merge "Add null checks for list access" into main

parents 86f579fb b91b1a67
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -1026,11 +1026,16 @@ void l2c_ble_link_adjust_allocation(void) {
      /* 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 ((p_lcb->link_state == LST_CONNECTED) && (!list_is_empty(p_lcb->link_xmit_data_q)) &&
      if (p_lcb->link_xmit_data_q != nullptr) {
        if ((p_lcb->link_state == LST_CONNECTED) &&
            !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,
                           l2c_lcb_timer_timeout, p_lcb);
        }
      } else {
        log::warn("link_xmit_data_q is null");
      }
    }
  }
}
+8 −3
Original line number Diff line number Diff line
@@ -665,11 +665,16 @@ void l2c_link_adjust_allocation(void) {
      /* 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 ((p_lcb->link_state == LST_CONNECTED) && (!list_is_empty(p_lcb->link_xmit_data_q)) &&
      if (p_lcb->link_xmit_data_q != nullptr) {
        if ((p_lcb->link_state == LST_CONNECTED) &&
            !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,
                           l2c_lcb_timer_timeout, p_lcb);
        }
      } else {
        log::warn("link_xmit_data_q is null");
      }
    }
  }
}