Commit b5e39020 authored by francescomani's avatar francescomani

temporary workaround to avoid heap-use-after-free

parent 7accacef
......@@ -732,23 +732,22 @@ void nr_rrc_mac_config_req_reset(module_id_t module_id,
reset_mac_inst(mac);
reset_ra(&mac->ra);
release_mac_configuration(mac);
for (int i = 0; i < NR_MAX_NUM_LCID; i++)
mac->active_RLC_bearer[i] = false;
mac->first_sync_frame = -1;
mac->get_sib1 = false;
mac->phy_config_request_sent = false;
mac->state = UE_NOT_SYNC;
release_mac_configuration(mac);
for (int i = 0; i < NR_MAX_NUM_LCID; i++)
mac->active_RLC_bearer[i] = false;
// Sending to PHY a request to resync
// with no target cell ID
mac->synch_request.Mod_id = module_id;
mac->synch_request.CC_id = 0;
mac->synch_request.synch_req.target_Nid_cell = -1;
mac->if_module->synch_request(&mac->synch_request);
}
void nr_rrc_mac_config_req_sib1(module_id_t module_id,
......@@ -828,7 +827,6 @@ void nr_rrc_mac_config_req_cg(module_id_t module_id,
LOG_I(MAC,"Applying CellGroupConfig from gNodeB\n");
AssertFatal(cell_group_config, "CellGroupConfig should not be NULL\n");
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
mac->cg = cell_group_config;
if (cell_group_config->mac_CellGroupConfig) {
// TODO handle MAC-CellGroupConfig
......
......@@ -425,7 +425,6 @@ typedef struct ssb_list_info {
/*!\brief Top level UE MAC structure */
typedef struct {
NR_UE_L2_STATE_t state;
NR_CellGroupConfig_t *cg;
int servCellIndex;
long physCellId;
//// MAC config
......
......@@ -189,26 +189,20 @@ void reset_mac_inst(NR_UE_MAC_INST_t *nr_mac)
void release_mac_configuration(NR_UE_MAC_INST_t *mac)
{
if(mac->cg) {
ASN_STRUCT_FREE(asn_DEF_NR_CellGroupConfig, mac->cg);
mac->cg = NULL;
}
if(mac->mib) {
ASN_STRUCT_FREE(asn_DEF_NR_MIB, mac->mib);
mac->mib = NULL;
}
// TODO properly freeing structures
// once separation between MAC and RRC is complete
mac->bwp_dlcommon = NULL;
mac->bwp_ulcommon = NULL;
if(mac->search_space_zero) {
ASN_STRUCT_FREE(asn_DEF_NR_SearchSpace, mac->search_space_zero);
mac->search_space_zero = NULL;
}
if(mac->ra_SS) {
ASN_STRUCT_FREE(asn_DEF_NR_SearchSpace, mac->ra_SS);
mac->ra_SS = NULL;
}
if(mac->otherSI_SS) {
ASN_STRUCT_FREE(asn_DEF_NR_SearchSpace, mac->otherSI_SS);
mac->otherSI_SS = NULL;
}
if(mac->coreset0) {
ASN_STRUCT_FREE(asn_DEF_NR_ControlResourceSet, mac->coreset0);
mac->coreset0 = NULL;
......
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