more coverity fixes

master
Andre Puschmann 7 years ago
parent 808e3a532b
commit 02856704c8

@ -102,7 +102,8 @@ void parse_args(int argc, char **argv) {
cfi = atoi(argv[optind]);
break;
case 'x':
strncpy(mimo_type_str, argv[optind], 32);
strncpy(mimo_type_str, argv[optind], 31);
mimo_type_str[31] = 0;
break;
case 'p':
pmi = (uint32_t) atoi(argv[optind]);

@ -711,13 +711,12 @@ int rf_uhd_recv_with_time(void *h,
}
int rf_uhd_recv_with_time_multi(void *h,
void **data,
void *data[SRSLTE_MAX_PORTS],
uint32_t nsamples,
bool blocking,
time_t *secs,
double *frac_secs)
{
rf_uhd_handler_t *handler = (rf_uhd_handler_t*) h;
uhd_rx_metadata_handle *md = &handler->rx_md_first;
size_t rxd_samples = 0;

@ -609,6 +609,7 @@ int setup_if_addr(char *ip_addr)
if(0 > ioctl(tun_fd, TUNSETIFF, &ifr))
{
perror("ioctl1");
close(tun_fd);
return -1;
}
@ -617,12 +618,14 @@ int setup_if_addr(char *ip_addr)
if(0 > ioctl(sock, SIOCGIFFLAGS, &ifr))
{
perror("socket");
close(tun_fd);
return -1;
}
ifr.ifr_flags |= IFF_UP | IFF_RUNNING;
if(0 > ioctl(sock, SIOCSIFFLAGS, &ifr))
{
perror("ioctl2");
close(tun_fd);
return -1;
}
@ -633,6 +636,7 @@ int setup_if_addr(char *ip_addr)
if(0 > ioctl(sock, SIOCSIFADDR, &ifr))
{
perror("ioctl");
close(tun_fd);
return -1;
}
ifr.ifr_netmask.sa_family = AF_INET;
@ -640,6 +644,7 @@ int setup_if_addr(char *ip_addr)
if(0 > ioctl(sock, SIOCSIFNETMASK, &ifr))
{
perror("ioctl");
close(tun_fd);
return -1;
}

@ -223,13 +223,11 @@ void phch_worker::work_imp()
bool ul_grant_available = false;
bool dl_ack[SRSLTE_MAX_CODEWORDS] = {false};
mac_interface_phy::mac_grant_t dl_mac_grant;
mac_interface_phy::tb_action_dl_t dl_action;
bzero(&dl_action, sizeof(mac_interface_phy::tb_action_dl_t));
mac_interface_phy::mac_grant_t dl_mac_grant = {};
mac_interface_phy::tb_action_dl_t dl_action = {};
mac_interface_phy::mac_grant_t ul_mac_grant;
mac_interface_phy::tb_action_ul_t ul_action;
bzero(&ul_action, sizeof(mac_interface_phy::tb_action_ul_t));
mac_interface_phy::mac_grant_t ul_mac_grant = {};
mac_interface_phy::tb_action_ul_t ul_action = {};
/** Calculate RSSI on the input signal before generating the output */
@ -1152,10 +1150,7 @@ void phch_worker::encode_srs()
float tx_power = srslte_ue_ul_srs_power(&ue_ul, phy->pathloss);
float gain = set_power(tx_power);
uint32_t fi = srslte_vec_max_fi((float*) signal_buffer, SRSLTE_SF_LEN_PRB(cell.nof_prb));
float *f = (float*) signal_buffer;
Info("SRS: power=%.2f dBm, tti_tx=%d%s\n", tx_power, TTI_TX(tti), timestr);
}
void phch_worker::enable_pregen_signals(bool enabled)

@ -193,9 +193,9 @@ void nas::notify_connection_setup() {
}
void nas::write_pdu(uint32_t lcid, byte_buffer_t *pdu) {
uint8 pd;
uint8 msg_type;
uint8 sec_hdr_type;
uint8 pd = 0;
uint8 msg_type = 0;
uint8 sec_hdr_type = 0;
bool mac_valid = false;
nas_log->info_hex(pdu->msg, pdu->N_bytes, "DL %s PDU", rrc->get_rb_name(lcid).c_str());
@ -216,7 +216,7 @@ void nas::write_pdu(uint32_t lcid, byte_buffer_t *pdu) {
case LIBLTE_MME_SECURITY_HDR_TYPE_INTEGRITY_AND_CIPHERED_WITH_NEW_EPS_SECURITY_CONTEXT:
break;
default:
nas_log->error("Not handling NAS message with SEC_HDR_TYPE=%02X\n",msg_type);
nas_log->error("Not handling NAS message with SEC_HDR_TYPE=%02X\n", sec_hdr_type);
pool->deallocate(pdu);
break;
}

@ -132,7 +132,7 @@ void setup_mac_phy_sib2(LIBLTE_RRC_SYS_INFO_BLOCK_TYPE_2_STRUCT *sib2, srsue::ma
memcpy(&common.pusch_cnfg, &sib2->rr_config_common_sib.pusch_cnfg, sizeof(LIBLTE_RRC_PUSCH_CONFIG_COMMON_STRUCT));
memcpy(&common.pucch_cnfg, &sib2->rr_config_common_sib.pucch_cnfg, sizeof(LIBLTE_RRC_PUCCH_CONFIG_COMMON_STRUCT));
memcpy(&common.ul_pwr_ctrl, &sib2->rr_config_common_sib.ul_pwr_ctrl, sizeof(LIBLTE_RRC_UL_POWER_CONTROL_COMMON_STRUCT));
memcpy(&common.prach_cnfg, &sib2->rr_config_common_sib.prach_cnfg, sizeof(LIBLTE_RRC_PRACH_CONFIG_STRUCT));
memcpy(&common.prach_cnfg, &sib2->rr_config_common_sib.prach_cnfg, sizeof(LIBLTE_RRC_PRACH_CONFIG_SIB_STRUCT));
if (sib2->rr_config_common_sib.srs_ul_cnfg.present) {
memcpy(&common.srs_ul_cnfg, &sib2->rr_config_common_sib.srs_ul_cnfg, sizeof(LIBLTE_RRC_SRS_UL_CONFIG_COMMON_STRUCT));
} else {

Loading…
Cancel
Save