fix: limit number of encoded PHICH in the scheduler to the max size of the array

master
Francisco 4 years ago committed by Andre Puschmann
parent 2b97b2c8bb
commit 2b59e90304

@ -323,6 +323,9 @@ const cc_sched_result& sched::carrier_sched::generate_tti_result(tti_point tti_r
/* Schedule PHICH */
for (auto& ue_pair : *ue_db) {
if (cc_result->ul_sched_result.nof_phich_elems >= MAX_PHICH_LIST) {
break;
}
tti_sched->alloc_phich(&ue_pair.second, &cc_result->ul_sched_result);
}

@ -879,6 +879,10 @@ alloc_outcome_t sf_sched::alloc_ul_user(sched_ue* user, prb_interval alloc)
bool sf_sched::alloc_phich(sched_ue* user, sched_interface::ul_sched_res_t* ul_sf_result)
{
if (ul_sf_result->nof_phich_elems >= sched_interface::MAX_PHICH_LIST) {
Warning("SCHED: Maximum number of PHICH allocations has been reached\n");
return false;
}
using phich_t = sched_interface::ul_sched_phich_t;
auto& phich_list = ul_sf_result->phich[ul_sf_result->nof_phich_elems];

Loading…
Cancel
Save