From a98a94e74ba11864ab57605f967ebc21f8616281 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Tue, 21 Apr 2020 14:07:33 +0200 Subject: [PATCH] fix some non-critical warnings found by Coverity scan --- lib/src/phy/common/test/sequence_test.c | 5 ++++- lib/src/phy/ue/test/ue_dl_nbiot_test.c | 4 ++-- lib/src/radio/test/benchmark_radio.cc | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/src/phy/common/test/sequence_test.c b/lib/src/phy/common/test/sequence_test.c index efc00e8cf..70a5c8744 100644 --- a/lib/src/phy/common/test/sequence_test.c +++ b/lib/src/phy/common/test/sequence_test.c @@ -177,7 +177,10 @@ int main(int argc, char** argv) } // Initialise sequence object - srslte_sequence_init(&sequence, max_length); + if (srslte_sequence_init(&sequence, max_length) != SRSLTE_SUCCESS) { + fprintf(stderr, "Error initializing sequence object\n"); + return SRSLTE_ERROR; + } printf("%8s; %8s; %8s; %8s; %8s; %8s; %8s\n", "seed", "length", "GEN", "XOR PS", "XOR 16", "XOR 8", "Passed"); diff --git a/lib/src/phy/ue/test/ue_dl_nbiot_test.c b/lib/src/phy/ue/test/ue_dl_nbiot_test.c index 4e99f8e61..76ac4ee37 100644 --- a/lib/src/phy/ue/test/ue_dl_nbiot_test.c +++ b/lib/src/phy/ue/test/ue_dl_nbiot_test.c @@ -72,7 +72,7 @@ int dl_grant_with_sib1_test() } // pass MIB to compute SIB1 parameters - srslte_mib_nb_t mib; + srslte_mib_nb_t mib = {}; mib.sched_info_sib1 = 3; // srslte_mib_nb_printf(stdout, cell, &mib); srslte_nbiot_ue_dl_set_mib(&ue_dl, mib); @@ -108,7 +108,7 @@ int dl_grant_with_sib2_test() } // pass MIB to compute SIB1 parameters - srslte_mib_nb_t mib; + srslte_mib_nb_t mib = {}; mib.sched_info_sib1 = 3; srslte_nbiot_ue_dl_set_mib(&ue_dl, mib); diff --git a/lib/src/radio/test/benchmark_radio.cc b/lib/src/radio/test/benchmark_radio.cc index a63dacab6..6c725b395 100644 --- a/lib/src/radio/test/benchmark_radio.cc +++ b/lib/src/radio/test/benchmark_radio.cc @@ -496,7 +496,7 @@ int main(int argc, char** argv) ret = SRSLTE_SUCCESS; - if (measure_delay) { + if (measure_delay && delay_count > 0) { for (uint32_t r = 1; r < nof_radios; r++) { printf("Radio %d is delayed %.1f samples from radio 0;\n", r, delay_idx[r] / delay_count); }