Return in nr_ue_get_sdu when mac->lc_ordered_list.count is 0
This count is used to size the dynamic array lcids_bj_pos. In case count is zero, this would lead to runtime error. With this change, the function will indicate to the caller that no SDUs are present and will print an error.
This commit is contained in:
@@ -2703,6 +2703,10 @@ static uint8_t nr_ue_get_sdu(NR_UE_MAC_INST_t *mac,
|
||||
mac->lc_ordered_list.count);
|
||||
|
||||
// variable used to build the lcids with positive Bj
|
||||
if (!mac->lc_ordered_list.count) {
|
||||
LOG_E(NR_MAC, "Failed to init lcids_bj_pos: mac->lc_ordered_list.count = 0\n");
|
||||
return 0;
|
||||
}
|
||||
nr_lcordered_info_t lcids_bj_pos[mac->lc_ordered_list.count];
|
||||
int avail_lcids_count = select_logical_channels(mac, lcids_bj_pos);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user