From 8198272571625d1486e8d30f826ea400d0161edd Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 27 Feb 2023 17:46:22 +0100 Subject: [PATCH] Review remarks --- common/utils/threadPool/thread-pool.h | 4 ++-- openair2/LAYER2/MAC/eNB_scheduler_mch.c | 6 ++++-- openair2/RRC/LTE/rrc_UE.c | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/common/utils/threadPool/thread-pool.h b/common/utils/threadPool/thread-pool.h index 762f288437..0c544e5b0f 100644 --- a/common/utils/threadPool/thread-pool.h +++ b/common/utils/threadPool/thread-pool.h @@ -292,7 +292,7 @@ static inline notifiedFIFO_elt_t *pullTpool(notifiedFIFO_t *responseFifo, tpool_ if (t->traceFd > 0) { ssize_t b = write(t->traceFd, msg, sizeof(*msg)); - AssertFatal(b > 0, "error in write(): %d, %s\n", errno, strerror(errno)); + AssertFatal(b == sizeof(*msg), "error in write(): %d, %s\n", errno, strerror(errno)); } return msg; @@ -309,7 +309,7 @@ static inline notifiedFIFO_elt_t *tryPullTpool(notifiedFIFO_t *responseFifo, tpo if (t->traceFd > 0) { ssize_t b = write(t->traceFd, msg, sizeof(*msg)); - AssertFatal(b > 0, "error in write(): %d, %s\n", errno, strerror(errno)); + AssertFatal(b == sizeof(*msg), "error in write(): %d, %s\n", errno, strerror(errno)); } return msg; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_mch.c b/openair2/LAYER2/MAC/eNB_scheduler_mch.c index 9184069481..ff8607a2db 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_mch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_mch.c @@ -140,10 +140,11 @@ schedule_MBMS_NFAPI(module_id_t module_idP, uint8_t CC_id, frame_t frameP, mac_rlc_status_resp_t rlc_status; int num_mtch=0; int msi_length=0, i, k; - int8_t j = -1; + unsigned char sdu_lcids[11], num_sdus = 0, offset = 0; uint16_t sdu_lengths[11], sdu_length_total = 0; unsigned char mch_buffer[MAX_DLSCH_PAYLOAD_BYTES]; // check the max value, this is for dlsch only + int16_t j = -1; COMMON_channels_t *cc = &RC.mac[module_idP]->common_channels[CC_id]; @@ -1124,7 +1125,8 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, unsigned char sdu_lcids[11], num_sdus = 0, offset = 0; uint16_t sdu_lengths[11], sdu_length_total = 0; unsigned char mch_buffer[MAX_DLSCH_PAYLOAD_BYTES]; // check the max value, this is for dlsch only - int8_t j = -1; + int16_t j = -1; + COMMON_channels_t *cc = &RC.mac[module_idP]->common_channels[CC_id]; cc->MCH_pdu.Pdu_size = 0; diff --git a/openair2/RRC/LTE/rrc_UE.c b/openair2/RRC/LTE/rrc_UE.c index 9d486948d2..022875bc68 100644 --- a/openair2/RRC/LTE/rrc_UE.c +++ b/openair2/RRC/LTE/rrc_UE.c @@ -1950,7 +1950,8 @@ rrc_ue_process_rrcConnectionReconfiguration( uint8_t *buffer; } msg; - msg.buffer = calloc(total_size, sizeof(uint8_t)); + msg.buffer = calloc(total_size, sizeof(*msg.buffer)); + AssertFatal(msg.buffer != NULL, "Error in memory allocation\n"); msg.RadioBearer_size = nr_RadioBearer->size; msg.SecondaryCellGroup_size = nr_SecondaryCellGroup->size; msg.trans_id = rrcConnectionReconfiguration->rrc_TransactionIdentifier;