From 6e18bd1c71dfe64416529b6675c42c1ad68f401e Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Tue, 21 Sep 2021 11:59:59 +0200 Subject: [PATCH] Do not accept a UE if SR resources are defined --- srsenb/src/stack/rrc/rrc_cell_cfg.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srsenb/src/stack/rrc/rrc_cell_cfg.cc b/srsenb/src/stack/rrc/rrc_cell_cfg.cc index 9524725f2..a922967e4 100644 --- a/srsenb/src/stack/rrc/rrc_cell_cfg.cc +++ b/srsenb/src/stack/rrc/rrc_cell_cfg.cc @@ -460,7 +460,7 @@ bool ue_cell_ded_list::alloc_sr_resources(uint32_t period) uint32_t max_users = 12 * c / delta_pucch_shift; // Find freq-time resources with least number of users - int i_min = 0, j_min = 0; + int i_min = -1, j_min = -1; uint32_t min_users = std::numeric_limits::max(); for (uint32_t i = 0; i < cfg.sr_cfg.nof_prb; i++) { for (uint32_t j = 0; j < cfg.sr_cfg.nof_subframes; j++) { @@ -472,7 +472,7 @@ bool ue_cell_ded_list::alloc_sr_resources(uint32_t period) } } - if (pucch_res->sr_sched.nof_users[i_min][j_min] > max_users) { + if (pucch_res->sr_sched.nof_users[i_min][j_min] > max_users || i_min == -1 || j_min == -1) { logger.error("Not enough PUCCH resources to allocate Scheduling Request"); return false; }