From 30075501502b121a213dffa184fe81eb5e4e26dc Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Thu, 28 Oct 2021 11:14:47 -0700 Subject: [PATCH] Updating DCI configuration to avoid seg fault --- openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c | 8 +++----- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 10 ---------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c index c3aaf87844..a1056a2f71 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c @@ -259,6 +259,9 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl //NR_ServingCellConfig_t *scd = mac->scg->spCellConfig->spCellConfigDedicated; NR_BWP_DownlinkDedicated_t *bwpd = (bwp_id>0) ? mac->DLbwp[bwp_id-1]->bwp_Dedicated : mac->cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP; NR_BWP_DownlinkCommon_t *bwp_Common = (bwp_id>0) ? mac->DLbwp[bwp_id-1]->bwp_Common : &mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP; + fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15 = &dl_config->dl_config_list[dl_config->number_pdus].dci_config_pdu.dci_config_rel15; + NR_SetupRelease_PDCCH_ConfigCommon_t *pdcch_ConfigCommon = bwp_Common->pdcch_ConfigCommon; + struct NR_PhysicalCellGroupConfig *phy_cgc = (mac->cg) ? mac->cg->physicalCellGroupConfig : NULL; LOG_D(NR_MAC, "[DCI_CONFIG] ra_rnti %p (%x) crnti %p (%x) t_crnti %p (%x)\n", &ra->ra_rnti, ra->ra_rnti, &mac->crnti, mac->crnti, &ra->t_crnti, ra->t_crnti); @@ -267,9 +270,6 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl for (ss_id = 0; ss_id < FAPI_NR_MAX_SS_PER_CORESET && mac->SSpace[bwp_id][coreset_id - 1][ss_id] != NULL; ss_id++){ LOG_D(NR_MAC, "[DCI_CONFIG] ss_id %d\n",ss_id); NR_SearchSpace_t *ss = mac->SSpace[bwp_id][coreset_id - 1][ss_id]; - fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15 = &dl_config->dl_config_list[dl_config->number_pdus].dci_config_pdu.dci_config_rel15; - NR_SetupRelease_PDCCH_ConfigCommon_t *pdcch_ConfigCommon = bwp_Common->pdcch_ConfigCommon; - struct NR_PhysicalCellGroupConfig *phy_cgc = mac->cg->physicalCellGroupConfig; switch (ss->searchSpaceType->present){ case NR_SearchSpace__searchSpaceType_PR_common: // this is for CSSs, we use BWP common and pdcch_ConfigCommon @@ -414,8 +414,6 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl } // Search space 0, CORESET ID 0 - NR_SetupRelease_PDCCH_ConfigCommon_t *pdcch_ConfigCommon = bwp_Common->pdcch_ConfigCommon; - if (pdcch_ConfigCommon && pdcch_ConfigCommon->choice.setup->searchSpaceSIB1 && !get_softmodem_params()->nsa) { diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index bd452b6513..ed33aa58f9 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -617,16 +617,6 @@ void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request, { nr_ue_ul_indication(&ul_info); } - - - #if 0 // TODO: Heap use after free caught by sanitizer - free(dl_info.dci_ind); - dl_info.dci_ind = NULL; - - free(dl_info.rx_ind); - dl_info.rx_ind = NULL; - #endif - } void save_nr_measurement_info(nfapi_nr_dl_tti_request_t *dl_tti_request)