Commit 4a3beb0b authored by francescomani's avatar francescomani

fix usage of asn_sequence_del to clear a list

parent 883724b9
...@@ -779,11 +779,8 @@ static void configure_logicalChannelBearer(NR_UE_MAC_INST_t *mac, ...@@ -779,11 +779,8 @@ static void configure_logicalChannelBearer(NR_UE_MAC_INST_t *mac,
if (id == mac->lc_ordered_list.array[j]->lcid) if (id == mac->lc_ordered_list.array[j]->lcid)
break; break;
} }
if (j < mac->lc_ordered_list.count) { if (j < mac->lc_ordered_list.count)
nr_lcordered_info_t *lc_info = mac->lc_ordered_list.array[j]; asn_sequence_del(&mac->lc_ordered_list, j, 1);
asn_sequence_del(&mac->lc_ordered_list, j, 0);
free(lc_info);
}
else else
LOG_E(NR_MAC, "Element not present in the list, impossible to release\n"); LOG_E(NR_MAC, "Element not present in the list, impossible to release\n");
} }
...@@ -1302,10 +1299,10 @@ static void configure_dedicated_BWP_dl(NR_UE_MAC_INST_t *mac, int bwp_id, NR_BWP ...@@ -1302,10 +1299,10 @@ static void configure_dedicated_BWP_dl(NR_UE_MAC_INST_t *mac, int bwp_id, NR_BWP
} }
if (dl_dedicated->pdcch_Config) { if (dl_dedicated->pdcch_Config) {
if (dl_dedicated->pdcch_Config->present == NR_SetupRelease_PDCCH_Config_PR_release) { if (dl_dedicated->pdcch_Config->present == NR_SetupRelease_PDCCH_Config_PR_release) {
for (int i = 0; pdcch->list_Coreset.count; i++) for (int i = pdcch->list_Coreset.count; i > 0 ; i--)
asn_sequence_del(&pdcch->list_Coreset, i, 1); asn_sequence_del(&pdcch->list_Coreset, i - 1, 1);
for (int i = 0; pdcch->list_SS.count; i++) for (int i = pdcch->list_SS.count; i > 0 ; i--)
asn_sequence_del(&pdcch->list_SS, i, 1); asn_sequence_del(&pdcch->list_SS, i - 1, 1);
} }
if (dl_dedicated->pdcch_Config->present == NR_SetupRelease_PDCCH_Config_PR_setup) if (dl_dedicated->pdcch_Config->present == NR_SetupRelease_PDCCH_Config_PR_setup)
configure_ss_coreset(pdcch, dl_dedicated->pdcch_Config->choice.setup); configure_ss_coreset(pdcch, dl_dedicated->pdcch_Config->choice.setup);
...@@ -2060,10 +2057,10 @@ void release_dl_BWP(NR_UE_MAC_INST_t *mac, int index) ...@@ -2060,10 +2057,10 @@ void release_dl_BWP(NR_UE_MAC_INST_t *mac, int index)
NR_BWP_PDCCH_t *pdcch = &mac->config_BWP_PDCCH[bwp_id]; NR_BWP_PDCCH_t *pdcch = &mac->config_BWP_PDCCH[bwp_id];
release_common_ss_cset(pdcch); release_common_ss_cset(pdcch);
for (int i = 0; pdcch->list_Coreset.count; i++) for (int i = pdcch->list_Coreset.count; i > 0 ; i--)
asn_sequence_del(&pdcch->list_Coreset, i, 1); asn_sequence_del(&pdcch->list_Coreset, i - 1, 1);
for (int i = 0; pdcch->list_SS.count; i++) for (int i = pdcch->list_SS.count; i > 0 ; i--)
asn_sequence_del(&pdcch->list_SS, i, 1); asn_sequence_del(&pdcch->list_SS, i - 1, 1);
} }
void release_ul_BWP(NR_UE_MAC_INST_t *mac, int index) void release_ul_BWP(NR_UE_MAC_INST_t *mac, int index)
......
...@@ -231,11 +231,8 @@ void release_mac_configuration(NR_UE_MAC_INST_t *mac, ...@@ -231,11 +231,8 @@ void release_mac_configuration(NR_UE_MAC_INST_t *mac,
asn1cFreeStruc(asn_DEF_NR_ControlResourceSet, mac->coreset0); asn1cFreeStruc(asn_DEF_NR_ControlResourceSet, mac->coreset0);
asn1cFreeStruc(asn_DEF_NR_SI_SchedulingInfo, mac->si_SchedulingInfo); asn1cFreeStruc(asn_DEF_NR_SI_SchedulingInfo, mac->si_SchedulingInfo);
asn1cFreeStruc(asn_DEF_NR_TDD_UL_DL_ConfigCommon, mac->tdd_UL_DL_ConfigurationCommon); asn1cFreeStruc(asn_DEF_NR_TDD_UL_DL_ConfigCommon, mac->tdd_UL_DL_ConfigurationCommon);
for (int i = 0; i < mac->lc_ordered_list.count; i++) { for (int i = mac->lc_ordered_list.count; i > 0 ; i--)
nr_lcordered_info_t *lc_info = mac->lc_ordered_list.array[i]; asn_sequence_del(&mac->lc_ordered_list, i - 1, 1);
asn_sequence_del(&mac->lc_ordered_list, i, 0);
free(lc_info);
}
} }
asn1cFreeStruc(asn_DEF_NR_CrossCarrierSchedulingConfig, sc->crossCarrierSchedulingConfig); asn1cFreeStruc(asn_DEF_NR_CrossCarrierSchedulingConfig, sc->crossCarrierSchedulingConfig);
...@@ -263,10 +260,10 @@ void release_mac_configuration(NR_UE_MAC_INST_t *mac, ...@@ -263,10 +260,10 @@ void release_mac_configuration(NR_UE_MAC_INST_t *mac,
// release dedicated BWP0 config // release dedicated BWP0 config
NR_UE_DL_BWP_t *bwp = mac->dl_BWPs.array[0]; NR_UE_DL_BWP_t *bwp = mac->dl_BWPs.array[0];
NR_BWP_PDCCH_t *pdcch = &mac->config_BWP_PDCCH[0]; NR_BWP_PDCCH_t *pdcch = &mac->config_BWP_PDCCH[0];
for (int i = 0; pdcch->list_Coreset.count; i++) for (int i = pdcch->list_Coreset.count; i > 0 ; i--)
asn_sequence_del(&pdcch->list_Coreset, i, 1); asn_sequence_del(&pdcch->list_Coreset, i - 1, 1);
for (int i = 0; pdcch->list_SS.count; i++) for (int i = pdcch->list_SS.count; i > 0 ; i--)
asn_sequence_del(&pdcch->list_SS, i, 1); asn_sequence_del(&pdcch->list_SS, i - 1, 1);
asn1cFreeStruc(asn_DEF_NR_PDSCH_Config, bwp->pdsch_Config); asn1cFreeStruc(asn_DEF_NR_PDSCH_Config, bwp->pdsch_Config);
NR_UE_UL_BWP_t *ubwp = mac->ul_BWPs.array[0]; NR_UE_UL_BWP_t *ubwp = mac->ul_BWPs.array[0];
asn1cFreeStruc(asn_DEF_NR_PUCCH_Config, ubwp->pucch_Config); asn1cFreeStruc(asn_DEF_NR_PUCCH_Config, ubwp->pucch_Config);
......
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