Commit d0b91a2a authored by Laurent THOMAS's avatar Laurent THOMAS

fix UE segv if current_DL_BWP->pdsch_servingcellconfig->ext1 is NULL (as it is optional

parent afc75c5d
......@@ -2928,16 +2928,12 @@ uint8_t compute_srs_resource_indicator(NR_PUSCH_ServingCellConfig_t *pusch_servi
//
// - otherwise, Lmax is given by the maximum number of layers for PUSCH supported by the UE for the serving cell
// for non-codebook based operation.
int Lmax = 0;
if (pusch_servingcellconfig != NULL) {
if (pusch_servingcellconfig->ext1->maxMIMO_Layers != NULL) {
Lmax = *pusch_servingcellconfig->ext1->maxMIMO_Layers;
} else {
AssertFatal(1 == 0, "MIMO on PUSCH not supported, maxMIMO_Layers needs to be set to 1\n");
}
} else {
AssertFatal(1 == 0, "MIMO on PUSCH not supported, maxMIMO_Layers needs to be set to 1\n");
}
int Lmax = 1;
if (pusch_servingcellconfig && pusch_servingcellconfig->ext1)
Lmax = *pusch_servingcellconfig->ext1->maxMIMO_Layers;
else if (pusch_Config)
Lmax = *pusch_Config->maxRank;
int lmin = 0;
int lsum = 0;
int count = 0;
......
......@@ -1113,9 +1113,10 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
nb_rb_oh, 0, Nl);
// TBS_LBRM according to section 5.4.2.1 of 38.212
long *maxMIMO_Layers = current_DL_BWP->pdsch_servingcellconfig->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 = 1;
if (current_DL_BWP->pdsch_servingcellconfig->ext1)
maxMIMO_Layers = *current_DL_BWP->pdsch_servingcellconfig->ext1->maxMIMO_Layers;
int nl_tbslbrm = maxMIMO_Layers < 4 ? maxMIMO_Layers : 4;
int bw_tbslbrm = get_dlbw_tbslbrm(current_DL_BWP->initial_BWPSize, mac->cg);
dlsch_config_pdu_1_1->tbslbrm = nr_compute_tbslbrm(dlsch_config_pdu_1_1->mcs_table,
bw_tbslbrm,
......
......@@ -662,14 +662,13 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
N_PRB_oh = 0;
if (current_UL_BWP->pusch_servingcellconfig && current_UL_BWP->pusch_servingcellconfig->rateMatching) {
long *maxMIMO_Layers = current_UL_BWP->pusch_servingcellconfig->ext1->maxMIMO_Layers;
if (!maxMIMO_Layers)
maxMIMO_Layers = pusch_Config ? pusch_Config->maxRank : NULL;
AssertFatal (maxMIMO_Layers != NULL,"Option with max MIMO layers not configured is not supported\n");
long maxMIMO_Layers = 1;
if (current_UL_BWP->pusch_servingcellconfig->ext1)
maxMIMO_Layers = *current_UL_BWP->pusch_servingcellconfig->ext1->maxMIMO_Layers;
else if (pusch_Config)
maxMIMO_Layers = *pusch_Config->maxRank;
int bw_tbslbrm = get_ulbw_tbslbrm(current_UL_BWP->initial_BWPSize, mac->cg);
pusch_config_pdu->tbslbrm = nr_compute_tbslbrm(pusch_config_pdu->mcs_table,
bw_tbslbrm,
*maxMIMO_Layers);
pusch_config_pdu->tbslbrm = nr_compute_tbslbrm(pusch_config_pdu->mcs_table, bw_tbslbrm, maxMIMO_Layers);
} else
pusch_config_pdu->tbslbrm = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment