diff --git a/ci-scripts/cppcheck_suppressions.list b/ci-scripts/cppcheck_suppressions.list index cad2aab88b4374811490153c509e941b2a2e4e57..727fd22e745ceb031a0c65938827efc49cab13dc 100644 --- a/ci-scripts/cppcheck_suppressions.list +++ b/ci-scripts/cppcheck_suppressions.list @@ -37,6 +37,7 @@ memleak:openair2/UTIL/OMG/omg_hashtable.c // _emm_as_encode function creates the encoded buffer // memleak:openair3/NAS/UE/EMM/SAP/emm_as.c +memleak:openair1/PHY/INIT/nr_init_ue.c //----------------------------------------------------------------------------- //***************************************************************************** // section for files not used in oai exec's included in CI. diff --git a/common/config/libconfig/config_libconfig.c b/common/config/libconfig/config_libconfig.c index b510ca28bc28f430f0a10ad5e81849e240f4f932..2e9fd614c504e286f5eeb728a4b03ab198ec1cf0 100644 --- a/common/config/libconfig/config_libconfig.c +++ b/common/config/libconfig/config_libconfig.c @@ -180,7 +180,7 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) { printf_params("[LIBCONFIG] %s: %llu\n", cfgpath,(long long unsigned)(*(cfgoptions[i].u64ptr)) ); } else { *(cfgoptions[i].i64ptr) = llu; - printf_params("[LIBCONFIG] %s: %llu\n", cfgpath,(long long)(*(cfgoptions[i].i64ptr)) ); + printf_params("[LIBCONFIG] %s: %lld\n", cfgpath,(long long)(*(cfgoptions[i].i64ptr)) ); } } else { defval=config_setdefault_int64(&(cfgoptions[i]),prefix); diff --git a/openair1/PHY/NR_TRANSPORT/nr_prach.c b/openair1/PHY/NR_TRANSPORT/nr_prach.c index 85e4df62cff9bfa90322ec349b88f86873fa97a0..c4951ffe4e03f207368cde44703f8eb2c93d30c2 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_prach.c +++ b/openair1/PHY/NR_TRANSPORT/nr_prach.c @@ -563,9 +563,6 @@ void rx_nr_prach(PHY_VARS_gNB *gNB, int16_t prach_ifft_tmp[2048*2] __attribute__((aligned(32))); int32_t *prach_ifft=(int32_t*)NULL; - - AssertFatal(gNB!=NULL,"gNB is null\n"); - fp = &gNB->frame_parms; nb_rx = gNB->gNB_config.carrier_config.num_rx_ant.value; diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index dccaccacaacad5fa0acc784f9a9a0b61eda3877a..166e2d7d7805f67bc6ec530ee2330a6196ebb9fe 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -1456,7 +1456,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, // non-coherent LLR computation on groups of 4 REs (half-PRBs) int32_t corr_re,corr_im,corr_tmp; __m128i corr16,llr_num,llr_den; - uint64_t corr; + uint64_t corr = 0; for (int half_prb=0;half_prb<(2*pucch_pdu->prb_size);half_prb++) { llr_num=_mm_set1_epi16(0);llr_den=_mm_set1_epi16(0); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index 693284a052e4e3a5548d8e38797e01833f19d1b2..d7441c01fd67e533b165c72dc9d49bef3817ed3c 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -211,7 +211,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, dlsch1_harq = dlsch[1]->harq_processes[codeword_TB1]; #ifdef DEBUG_HARQ - printf("[DEMOD] I am assuming only TB1 is active, it is in cw %d\n", dlsch0_harq->codeword); + printf("[DEMOD] I am assuming only TB1 is active, it is in cw %d\n", dlsch1_harq->codeword); #endif AssertFatal(1 == 0, "[UE][FATAL] DLSCH: TB0 not active and TB1 active case is not supported %d\n"); @@ -230,6 +230,9 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, } + if (dlsch0_harq = NULL) + AssertFatal(1 == 0, "Done\n"); + dlsch0_harq->Qm = nr_get_Qm_dl(dlsch[0]->harq_processes[harq_pid]->mcs, dlsch[0]->harq_processes[harq_pid]->mcs_table); dlsch0_harq->R = nr_get_code_rate_dl(dlsch[0]->harq_processes[harq_pid]->mcs, dlsch[0]->harq_processes[harq_pid]->mcs_table); diff --git a/openair1/PHY/TOOLS/nr_phy_scope.c b/openair1/PHY/TOOLS/nr_phy_scope.c index 61a38098a607a00b9981f4ad099f40a7a9a18a41..e7f83c5f76cd3c928968411011ab02f834b77061 100644 --- a/openair1/PHY/TOOLS/nr_phy_scope.c +++ b/openair1/PHY/TOOLS/nr_phy_scope.c @@ -286,6 +286,8 @@ static void puschIQ (FL_OBJECT *graph, PHY_VARS_gNB *phy_vars_gnb, RU_t *phy_var fl_set_xyplot_data(graph,I,Q,sz,"","",""); // PUSCH I/Q of MF Output +// Code to fixed, disabled for cppcheck +#if 0 if (NULL) { int32_t *pucch1ab_comp = (int32_t *) NULL; //phy_vars_gnb->pucch1ab_stats[UE_id]; int32_t *pucch1_comp = (int32_t *) NULL; //phy_vars_gnb->pucch1_stats[UE_id]; @@ -307,6 +309,7 @@ static void puschIQ (FL_OBJECT *graph, PHY_VARS_gNB *phy_vars_gnb, RU_t *phy_var fl_set_xyplot_xbounds(graph,-5000,5000); fl_set_xyplot_ybounds(graph,0,80); } +#endif } static void pucchEnergy (FL_OBJECT *graph, PHY_VARS_gNB *phy_vars_gnb, RU_t *phy_vars_ru, int UE_id) { diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index caf644932af4e7a80429b095ce9d7284df570cf5..6c0aacadc2deafa4727915b24a3766c8ccb61bc3 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -4111,12 +4111,13 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, LOG_D(PHY,"[UE %d] Frame %d, nr_tti_rx %d: found %d DCIs\n", ue->Mod_id, frame_rx, nr_tti_rx, dci_cnt); - NR_UE_DLSCH_t *dlsch; + NR_UE_DLSCH_t *dlsch = NULL; if (ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active == 1){ dlsch = ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]; } else if (ue->dlsch_ra[0]->active == 1){ dlsch = ue->dlsch_ra[0]; } + AssertFatal(dlsch != NULL, "Unsupported mode\n"); uint8_t harq_pid = dlsch->current_harq_pid; NR_DL_UE_HARQ_t *dlsch0_harq = dlsch->harq_processes[harq_pid]; uint16_t nb_symb_sch = dlsch0_harq->nb_symbols; diff --git a/openair1/SIMULATION/NR_PHY/nr_dummy_functions_prach.c b/openair1/SIMULATION/NR_PHY/nr_dummy_functions_prach.c index e62155e54e023242e70ccf4a83e891fe9cd4777a..bfb9150868da49fb40a79d0dc42d6a6211ca7248 100644 --- a/openair1/SIMULATION/NR_PHY/nr_dummy_functions_prach.c +++ b/openair1/SIMULATION/NR_PHY/nr_dummy_functions_prach.c @@ -91,7 +91,7 @@ void nr_get_prach_resources(module_id_t mod_id, NR_RACH_ConfigCommon_t *nr_rach_ConfigCommon; // NR_BeamFailureRecoveryConfig_t *beam_failure_recovery_config = &mac->RA_BeamFailureRecoveryConfig; // todo - int messagePowerOffsetGroupB, messageSizeGroupA, PLThreshold, sizeOfRA_PreamblesGroupA, numberOfRA_Preambles, i, deltaPreamble_Msg3; + int messagePowerOffsetGroupB = 0, messageSizeGroupA, PLThreshold, sizeOfRA_PreamblesGroupA, numberOfRA_Preambles, i, deltaPreamble_Msg3 = 0; uint8_t noGroupB = 0, s_id, f_id, ul_carrier_id, msg1_FDM, prach_ConfigIndex, SFN_nbr, Msg3_size; // NR_RSRP_Range_t rsrp_ThresholdSSB; // todo diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c index f948cd43fb4f68c26185da1b8b5a9c855bb6a914..b7aea902a9ef280103402d2159c4faca8f1580c2 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c @@ -88,7 +88,7 @@ void nr_get_prach_resources(module_id_t mod_id, // NR_BeamFailureRecoveryConfig_t *beam_failure_recovery_config = &mac->RA_BeamFailureRecoveryConfig; // todo - int messagePowerOffsetGroupB, messageSizeGroupA, PLThreshold, sizeOfRA_PreamblesGroupA, numberOfRA_Preambles, i, deltaPreamble_Msg3; + int messagePowerOffsetGroupB = 0, messageSizeGroupA, PLThreshold, sizeOfRA_PreamblesGroupA, numberOfRA_Preambles, i, deltaPreamble_Msg3 = 0; uint8_t noGroupB = 0, s_id, f_id, ul_carrier_id, prach_ConfigIndex, SFN_nbr, Msg3_size; AssertFatal(scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup != NULL, "[UE %d] FATAL nr_rach_ConfigCommon is NULL !!!\n", mod_id); diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 8e4d0925917b9aae065ce5edd39517fab2cb1366..0da02bd7d1475f707b2ba8a98a77f7a62271dc91 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -934,7 +934,7 @@ void nr_ue_msg2_scheduler(module_id_t mod_id, // and if the slot is not among the PDCCH monitored ones (38.213 10.1) while ((*msg2_slot > slot_limit) || ((*msg2_frame*nr_slots_per_frame[mu] + *msg2_slot - monitoring_offset) % monitoring_slot_period != 0)) { if((*msg2_slot % tdd_period_slot) > 0) - *msg2_slot--; + (*msg2_slot)--; else AssertFatal(1 == 0, "No available DL slot to schedule reception of msg2 has been found"); } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 719571e29c4619572fdfd1b4dc51761563bc3452..ba45def3f54388b69f03d80457b979187977db64 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -225,7 +225,7 @@ void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot, // and if the slot is not among the PDCCH monitored ones (38.213 10.1) while ((*msg2_slot>slot_limit) || ((*msg2_frame*nr_slots_per_frame[mu]+*msg2_slot-monitoring_offset)%monitoring_slot_period !=0)) { if((*msg2_slot%tdd_period_slot) > 0) - *msg2_slot--; + (*msg2_slot)--; else AssertFatal(1==0,"No available DL slot to schedule msg2 has been found"); }