Commit f1abe9a8 authored by r.karey's avatar r.karey Committed by guhan

fixed memory leaks

parent 6f9f426a
......@@ -601,13 +601,10 @@ void handle_nr_uci_pucch_2_3_4(module_id_t mod_id,
if ( uci_234 -> pduBitmap & 0x01 ) {
///Handle SR PDU
uint8_t sr_id = 0;
uint8_t payload_size = ceil(uci_234->sr.sr_bit_len/8);
uint8_t *payload = calloc (payload_size, sizeof (uint8_t));
memcpy (payload, uci_234->sr.sr_payload, payload_size);
for (sr_id = 0; sr_id < uci_234->sr.sr_bit_len; sr_id++) {
sched_ctrl->sr_req.ul_SR[sr_id] = *payload & 1;
*payload >>= 1;
sched_ctrl->sr_req.ul_SR[sr_id] = uci_234->sr.sr_payload & 1;
uci_234->sr.sr_payload >>= 1;
}
sched_ctrl->sr_req.nr_of_srs = uci_234->sr.sr_bit_len;
......@@ -625,6 +622,8 @@ void handle_nr_uci_pucch_2_3_4(module_id_t mod_id,
scs);
//API to parse the csi report and store it into sched_ctrl
extract_pucch_csi_report (csi_MeasConfig, uci_pdu, sched_ctrl,UL_info->frame, UL_info->slot, scs, UE_id, Mod_idP);
//TCI handling function
tci_handling(Mod_idP, UE_id, UL_info->CC_id, sched_ctrl, UL_info->frame, UL_info->slot);
}
if (uci_pdu -> pduBitmap & 0x08) {
......@@ -1283,7 +1282,8 @@ void extract_pucch_csi_report (NR_CSI_MeasConfig_t *csi_MeasConfig,
if ( !(reportQuantity_type))
AssertFatal(reportQuantity_type, "reportQuantity is not configured");
free(payload);
payload = NULL;
#if 0
if ( NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI == reportQuantity_type ||
......
......@@ -131,16 +131,12 @@ void extract_pucch_csi_report ( NR_CSI_MeasConfig_t *csi_MeasConfig,
/** From Table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel */
uint8_t idx = 0;
uint8_t payload_size = ceil(((double)uci_pdu->csi_part1.csi_part1_bit_len)/8);
uint8_t *payload = calloc (payload_size, sizeof(uint8_t));
uint8_t *payload = uci_pdu->csi_part1.csi_part1_payload;
NR_CSI_ReportConfig__reportQuantity_PR reportQuantity_type = NR_CSI_ReportConfig__reportQuantity_PR_NOTHING;
NR_UE_list_t *UE_list = &(RC.nrmac[Mod_idP]->UE_list);
long periodicity;
uint8_t csi_report_id = 0;
memcpy ( payload, uci_pdu->csi_part1.csi_part1_payload, payload_size);
UE_list->csi_report_template[UE_id][csi_report_id].nb_of_csi_ssb_report = 0;
for ( csi_report_id =0; csi_report_id < csi_MeasConfig->csi_ReportConfigToAddModList->list.count; csi_report_id++ ) {
//Assuming in periodic reporting for one slot can be configured with only one CSI-ReportConfig
......@@ -208,7 +204,7 @@ void extract_pucch_csi_report ( NR_CSI_MeasConfig_t *csi_MeasConfig,
*payload >>= 4;
}
UE_list->csi_report_template[UE_id][csi_report_id].nb_of_csi_ssb_report++;
LOG_I(MAC,"csi_payload size = %d, rsrp_id = %d\n",payload_size, sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP);
LOG_I(MAC," rsrp_id = %d\n", sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP);
}
}
......
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