Bugfix: make preamble_list an array

- It is only a couple of bytes
- It hid a bug: if two preambles, L1_nr_prach_procedures() overwrote the
  preamble of the first with the second one
This commit is contained in:
Robert Schmidt
2024-04-04 18:55:53 +02:00
parent 0f1f76878e
commit e6e25275ed
9 changed files with 8 additions and 33 deletions
-5
View File
@@ -731,7 +731,6 @@ int phy_nr_rach_indication(nfapi_nr_rach_indication_t *ind)
rach_ind->pdu_list[i].num_preamble = ind->pdu_list[i].num_preamble;
rach_ind->pdu_list[i].freq_index = ind->pdu_list[i].freq_index;
rach_ind->pdu_list[i].symbol_index = ind->pdu_list[i].symbol_index;
rach_ind->pdu_list[i].preamble_list = CALLOC(ind->pdu_list[i].num_preamble, sizeof(nfapi_nr_prach_indication_preamble_t));
AssertFatal(rach_ind->pdu_list[i].preamble_list != NULL, "Memory not allocated for rach_ind->pdu_list[i].preamble_list in phy_nr_rach_indication.");
for (int j = 0; j < ind->number_of_pdus; j++)
{
@@ -742,10 +741,6 @@ int phy_nr_rach_indication(nfapi_nr_rach_indication_t *ind)
if (!put_queue(&gnb_rach_ind_queue, rach_ind))
{
LOG_E(NR_MAC, "Put_queue failed for rach_ind\n");
for (int i = 0; i < ind->number_of_pdus; i++)
{
free(rach_ind->pdu_list[i].preamble_list);
}
free(rach_ind->pdu_list);
free(rach_ind);
}