From 970bfc92f02e71ecfc3cd6a63920f9986d599617 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 28 Jul 2022 07:20:31 +0100 Subject: [PATCH] Fix a segmentation fault when there is no spCellConfigDedicated with maxMIMO_Layers parameter --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index d9a0a50b7e..a4c034bb8f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -1120,9 +1120,8 @@ void nr_schedule_ue_spec(module_id_t module_id, csi_report->codebook_mode); } // TBS_LBRM according to section 5.4.2.1 of 38.212 - long *maxMIMO_Layers = cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers; - AssertFatal (maxMIMO_Layers != NULL,"Option with max MIMO layers not configured is not supported\n"); - int nl_tbslbrm = *maxMIMO_Layers < 4 ? *maxMIMO_Layers : 4; + long maxMIMO_Layers = cg && cg->spCellConfig && cg->spCellConfig->spCellConfigDedicated ? *cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers : 1; + int nl_tbslbrm = maxMIMO_Layers < 4 ? maxMIMO_Layers : 4; // Maximum number of PRBs across all configured DL BWPs int bw_tbslbrm = get_bw_tbslbrm(genericParameters, cg); pdsch_pdu->maintenance_parms_v3.tbSizeLbrmBytes = nr_compute_tbslbrm(ps->mcsTableIdx,