Merge remote-tracking branch 'origin/fix-cellconfig-segv' into integration_2023_w43
This commit is contained in:
@@ -970,16 +970,40 @@ static NR_ServingCellConfigCommon_t *get_scc_config(int minRXTXTIME)
|
||||
fix_scc(scc, ssb_bitmap);
|
||||
}
|
||||
nr_rrc_config_ul_tda(scc, minRXTXTIME);
|
||||
|
||||
// the gNB uses the servingCellConfigCommon everywhere, even when it should use the servingCellConfigCommonSIB.
|
||||
// previously (before this commit), the following fields were indirectly populated through get_SIB1_NR().
|
||||
// since this might lead to memory problems (e.g., double frees), it has been moved here.
|
||||
// note that the "right solution" would be to not populate the servingCellConfigCommon here, and use
|
||||
// an "abstraction struct" that contains the corresponding values, from which SCC/SIB1/... is generated.
|
||||
NR_PDCCH_ConfigCommon_t *pcc = scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup;
|
||||
AssertFatal(pcc != NULL && pcc->commonSearchSpaceList == NULL, "memory leak\n");
|
||||
pcc->commonSearchSpaceList = calloc_or_fail(1, sizeof(*pcc->commonSearchSpaceList));
|
||||
|
||||
NR_SearchSpace_t *ss1 = rrc_searchspace_config(true, 1, 0);
|
||||
asn1cSeqAdd(&pcc->commonSearchSpaceList->list, ss1);
|
||||
NR_SearchSpace_t *ss2 = rrc_searchspace_config(true, 2, 0);
|
||||
asn1cSeqAdd(&pcc->commonSearchSpaceList->list, ss2);
|
||||
NR_SearchSpace_t *ss3 = rrc_searchspace_config(true, 3, 0);
|
||||
asn1cSeqAdd(&pcc->commonSearchSpaceList->list, ss3);
|
||||
|
||||
asn1cCallocOne(pcc->searchSpaceSIB1, 0);
|
||||
asn1cCallocOne(pcc->ra_SearchSpace, 1);
|
||||
asn1cCallocOne(pcc->pagingSearchSpace, 2);
|
||||
asn1cCallocOne(pcc->searchSpaceOtherSystemInformation, 3);
|
||||
|
||||
return scc;
|
||||
}
|
||||
|
||||
static NR_ServingCellConfig_t *get_scd_config(void)
|
||||
{
|
||||
char aprefix[MAX_OPTNAME_SIZE*2 + 8];
|
||||
NR_ServingCellConfig_t *scd = calloc(1, sizeof(*scd));
|
||||
prepare_scd(scd);
|
||||
paramdef_t SCDsParams[] = SCDPARAMS_DESC(scd);
|
||||
paramlist_def_t SCDsParamList = {GNB_CONFIG_STRING_SERVINGCELLCONFIGDEDICATED, NULL, 0};
|
||||
|
||||
char aprefix[MAX_OPTNAME_SIZE * 2 + 8];
|
||||
snprintf(aprefix, sizeof(aprefix), "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, 0);
|
||||
config_getlist(&SCDsParamList, NULL, 0, aprefix);
|
||||
if (SCDsParamList.numelt > 0) {
|
||||
sprintf(aprefix, "%s.[%i].%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, 0, GNB_CONFIG_STRING_SERVINGCELLCONFIGDEDICATED, 0);
|
||||
|
||||
Reference in New Issue
Block a user