Skip to content

Commit c892ae5

Browse files
rrc_cell_cfg: fix potential div by zero
similar fix has been applied for SR resources
1 parent 12ffce3 commit c892ae5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

srsenb/src/stack/rrc/rrc_cell_cfg.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ bool cell_ctxt_dedicated_list::alloc_sr_resources(uint32_t period)
292292

293293
uint32_t c = SRSLTE_CP_ISNORM(cfg.cell.cp) ? 3 : 2;
294294
uint32_t delta_pucch_shift = cell->cell_common.sib2.rr_cfg_common.pucch_cfg_common.delta_pucch_shift.to_number();
295+
delta_pucch_shift = SRSLTE_MAX(1, delta_pucch_shift); // prevent div by zero
295296
uint32_t max_users = 12 * c / delta_pucch_shift;
296297

297298
// Find freq-time resources with least number of users

0 commit comments

Comments
 (0)