Prevent segfault when trying to schedule MAX_MOBILES_PER_GNB UEs
When the UE list is full, the iterator will run through all MAX_MOBILES_PER_GNB UEs. It expects that eventually the pointer is NULL, which is not the case if we have MAX_MOBILES_PER_GNB (or it simply depends on the following memory). So give one array entry more, to ensure that the last one is NULL.
This commit is contained in:
@@ -613,7 +613,7 @@ static void pf_dl(module_id_t module_id,
|
|||||||
gNB_MAC_INST *mac = RC.nrmac[module_id];
|
gNB_MAC_INST *mac = RC.nrmac[module_id];
|
||||||
NR_ServingCellConfigCommon_t *scc=mac->common_channels[0].ServingCellConfigCommon;
|
NR_ServingCellConfigCommon_t *scc=mac->common_channels[0].ServingCellConfigCommon;
|
||||||
// UEs that could be scheduled
|
// UEs that could be scheduled
|
||||||
UEsched_t UE_sched[MAX_MOBILES_PER_GNB] = {0};
|
UEsched_t UE_sched[MAX_MOBILES_PER_GNB + 1] = {0};
|
||||||
int remainUEs = max_num_ue;
|
int remainUEs = max_num_ue;
|
||||||
int curUE = 0;
|
int curUE = 0;
|
||||||
int CC_id = 0;
|
int CC_id = 0;
|
||||||
|
|||||||
@@ -1790,7 +1790,7 @@ static void pf_ul(module_id_t module_id,
|
|||||||
|
|
||||||
const int min_rb = nrmac->min_grant_prb;
|
const int min_rb = nrmac->min_grant_prb;
|
||||||
// UEs that could be scheduled
|
// UEs that could be scheduled
|
||||||
UEsched_t UE_sched[MAX_MOBILES_PER_GNB] = {0};
|
UEsched_t UE_sched[MAX_MOBILES_PER_GNB + 1] = {0};
|
||||||
int remainUEs = max_num_ue;
|
int remainUEs = max_num_ue;
|
||||||
int curUE = 0;
|
int curUE = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user