diff --git a/common/utils/itti/intertask_interface.c b/common/utils/itti/intertask_interface.c index cc1cd468ee14664221e66fd9eb42c5627368d759..cc95e58c0911fcfd799e72bbd7bae39f4ebd6f30 100644 --- a/common/utils/itti/intertask_interface.c +++ b/common/utils/itti/intertask_interface.c @@ -315,7 +315,8 @@ int itti_send_broadcast_message(MessageDef *message_p) { } } } - itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p); + result = itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); return ret; } @@ -460,7 +461,8 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me } } else { /* This is a debug message to TASK_UNKNOWN, we can release safely release it */ - itti_free(origin_task_id, message); + int result = itti_free(origin_task_id, message); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); } #if defined(OAI_EMU) || defined(RTAI) @@ -583,8 +585,9 @@ static inline void itti_receive_msg_internal_event_fd(task_id_t task_id, uint8_t (itti_desc.threads[thread_id].events[i].data.fd == itti_desc.threads[thread_id].task_event_fd)) { struct message_list_s *message = NULL; - eventfd_t sem_counter; - ssize_t read_ret; + eventfd_t sem_counter; + ssize_t read_ret; + int result; /* Read will always return 1 */ read_ret = read (itti_desc.threads[thread_id].task_event_fd, &sem_counter, sizeof(sem_counter)); @@ -601,7 +604,9 @@ static inline void itti_receive_msg_internal_event_fd(task_id_t task_id, uint8_t } AssertFatal(message != NULL, "Message from message queue is NULL!\n"); *received_msg = message->msg; - itti_free (ITTI_MSG_ORIGIN_ID(*received_msg), message); + result = itti_free (ITTI_MSG_ORIGIN_ID(*received_msg), message); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); + /* Mark that the event has been processed */ itti_desc.threads[thread_id].events[i].events &= ~EPOLLIN; return; @@ -655,8 +660,11 @@ void itti_poll_msg(task_id_t task_id, MessageDef **received_msg) { if (lfds611_queue_dequeue (itti_desc.tasks[task_id].message_queue, (void **) &message) == 1) { + int result; + *received_msg = message->msg; - itti_free (ITTI_MSG_ORIGIN_ID(*received_msg), message); + result = itti_free (ITTI_MSG_ORIGIN_ID(*received_msg), message); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); } } diff --git a/common/utils/itti/intertask_interface_dump.c b/common/utils/itti/intertask_interface_dump.c index 8d434d61fdbbc5d18d1122dddf71ec126a7424a9..20dacb9ee36a90bc81b8a7e0586324e4d92f6bdc 100644 --- a/common/utils/itti/intertask_interface_dump.c +++ b/common/utils/itti/intertask_interface_dump.c @@ -266,19 +266,23 @@ static void itti_dump_user_data_delete_function(void *user_data, void *user_stat { itti_dump_queue_item_t *item; task_id_t task_id; + int result; item = (itti_dump_queue_item_t *)user_data; if (item->data != NULL) { + task_id = ITTI_MSG_ORIGIN_ID(item->data); - itti_free(task_id, item->data); + result = itti_free(task_id, item->data); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); } else { task_id = TASK_UNKNOWN; } - itti_free(task_id, item); + result = itti_free(task_id, item); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); } } diff --git a/openair-cn/NAS/nas_ue_task.c b/openair-cn/NAS/nas_ue_task.c index f0654277882663e650fb344df55f698413ccd5bd..daf9b59ce95ad86fb786bc599d94504cfc2f7f25 100644 --- a/openair-cn/NAS/nas_ue_task.c +++ b/openair-cn/NAS/nas_ue_task.c @@ -170,7 +170,7 @@ void *nas_ue_task(void *args_p) { /* TODO checks if NAS will free the nas message, better to do it there anyway! */ result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), NAS_CONN_ESTABLI_CNF(msg_p).nasMsg.data); - AssertFatal (result == EXIT_SUCCESS, "Failed to free memory!\n"); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); } break; @@ -198,9 +198,11 @@ void *nas_ue_task(void *args_p) { nas_proc_dl_transfer_ind (NAS_DOWNLINK_DATA_IND(msg_p).nasMsg.data, NAS_DOWNLINK_DATA_IND(msg_p).nasMsg.length); + if (0) { /* TODO checks if NAS will free the nas message, better to do it there anyway! */ result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), NAS_DOWNLINK_DATA_IND(msg_p).nasMsg.data); - AssertFatal (result == EXIT_SUCCESS, "Failed to free memory!\n"); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); + } break; default: @@ -208,7 +210,8 @@ void *nas_ue_task(void *args_p) { break; } - itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); + result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); msg_p = NULL; } diff --git a/openair-cn/S1AP/s1ap_eNB.c b/openair-cn/S1AP/s1ap_eNB.c index 6f8c4153d2e1220e9c89046c90c7f38467bdc7f1..fbd2d339612033b67217e499694525e0e24fa977 100644 --- a/openair-cn/S1AP/s1ap_eNB.c +++ b/openair-cn/S1AP/s1ap_eNB.c @@ -225,17 +225,21 @@ void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_associa static void s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind) { + int result; + DevAssert(sctp_data_ind != NULL); s1ap_eNB_handle_message(sctp_data_ind->assoc_id, sctp_data_ind->stream, sctp_data_ind->buffer, sctp_data_ind->buffer_length); - itti_free(TASK_UNKNOWN, sctp_data_ind->buffer); + result = itti_free(TASK_UNKNOWN, sctp_data_ind->buffer); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); } void *s1ap_eNB_task(void *arg) { MessageDef *received_msg = NULL; + int result; S1AP_DEBUG("Starting S1AP layer\n"); @@ -288,7 +292,8 @@ void *s1ap_eNB_task(void *arg) break; } - itti_free (ITTI_MSG_ORIGIN_ID(received_msg), received_msg); + result = itti_free (ITTI_MSG_ORIGIN_ID(received_msg), received_msg); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); received_msg = NULL; } diff --git a/openair-cn/SCTP/sctp_eNB_task.c b/openair-cn/SCTP/sctp_eNB_task.c index a778115589e493c32f4130a23eb01aa73e87b4ce..4bab71d50b313e40675c01ca5be02418e16ba350 100644 --- a/openair-cn/SCTP/sctp_eNB_task.c +++ b/openair-cn/SCTP/sctp_eNB_task.c @@ -528,6 +528,7 @@ void *sctp_eNB_task(void *arg) int nb_events; struct epoll_event *events; MessageDef *received_msg = NULL; + int result; SCTP_DEBUG("Starting SCTP layer\n"); @@ -560,7 +561,8 @@ void *sctp_eNB_task(void *arg) ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg)); break; } - itti_free(ITTI_MSG_ORIGIN_ID(received_msg), received_msg); + result = itti_free(ITTI_MSG_ORIGIN_ID(received_msg), received_msg); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); received_msg = NULL; } diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 8e30a72012bf7f6aeb783290f9300ac2027be126..2f57210ab34c15dc7e6e8133fe89b7280f9dc50d 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -3515,10 +3515,11 @@ int phy_procedures_RN_eNB_TX(unsigned char last_slot, unsigned char next_slot, r void phy_procedures_eNB_lte(unsigned char last_slot, unsigned char next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag, relaying_type_t r_type, PHY_VARS_RN *phy_vars_rn) { #if defined(ENABLE_ITTI) - MessageDef *msg_p; - const char *msg_name; - instance_t instance; - unsigned int Mod_id; + MessageDef *msg_p; + const char *msg_name; + instance_t instance; + unsigned int Mod_id; + int result; #endif /* if (phy_vars_eNB->frame >= 1000) @@ -3531,7 +3532,7 @@ void phy_procedures_eNB_lte(unsigned char last_slot, unsigned char next_slot,PHY #if defined(ENABLE_ITTI) do { // Checks if a message has been sent to PHY sub-task - itti_poll_msg ( TASK_PHY_ENB, &msg_p); + itti_poll_msg (TASK_PHY_ENB, &msg_p); if (msg_p != NULL) { msg_name = ITTI_MSG_NAME (msg_p); @@ -3545,7 +3546,8 @@ void phy_procedures_eNB_lte(unsigned char last_slot, unsigned char next_slot,PHY break; } - itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); + result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); } } while(msg_p != NULL); #endif diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 89d1879a838f384499da06a4b38e7c1a50e0de60..89f95a906acff7e76ed550fe2df67a2fe7250fb0 100755 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -38,6 +38,7 @@ * \warning */ +#include "assertions.h" #include "defs.h" #include "PHY/defs.h" #include "PHY/extern.h" @@ -3169,10 +3170,11 @@ int phy_procedures_RN_UE_RX(u8 last_slot, u8 next_slot, relaying_type_t r_type) void phy_procedures_UE_lte(u8 last_slot, u8 next_slot, PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode, relaying_type_t r_type, PHY_VARS_RN *phy_vars_rn) { #if defined(ENABLE_ITTI) - MessageDef *msg_p; - const char *msg_name; - instance_t instance; - unsigned int Mod_id; + MessageDef *msg_p; + const char *msg_name; + instance_t instance; + unsigned int Mod_id; + int result; #endif #undef DEBUG_PHY_PROC @@ -3200,7 +3202,7 @@ int phy_procedures_RN_UE_RX(u8 last_slot, u8 next_slot, relaying_type_t r_type) #if defined(ENABLE_ITTI) do { // Checks if a message has been sent to PHY sub-task - itti_poll_msg ( TASK_PHY_UE, &msg_p); + itti_poll_msg (TASK_PHY_UE, &msg_p); if (msg_p != NULL) { msg_name = ITTI_MSG_NAME (msg_p); @@ -3219,7 +3221,8 @@ int phy_procedures_RN_UE_RX(u8 last_slot, u8 next_slot, relaying_type_t r_type) break; } - itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); + result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); } } while(msg_p != NULL); #endif diff --git a/openair2/ENB_APP/enb_app.c b/openair2/ENB_APP/enb_app.c index 47e9ce7dc50164b2e3601020bce4c5581281c36f..034790ed6f9b4597a981658d10c4f1f4774cd576 100644 --- a/openair2/ENB_APP/enb_app.c +++ b/openair2/ENB_APP/enb_app.c @@ -321,7 +321,9 @@ void *eNB_app_task(void *args_p) # endif MessageDef *msg_p; const char *msg_name; - instance_t instance; + instance_t instance; + int result; + itti_mark_task_ready (TASK_ENB_APP); # if defined(ENABLE_USE_MME) @@ -406,9 +408,9 @@ void *eNB_app_task(void *args_p) if (timer_setup (ENB_REGISTER_RETRY_DELAY, 0, TASK_ENB_APP, INSTANCE_DEFAULT, TIMER_ONE_SHOT, NULL, &enb_register_retry_timer_id) < 0) { - LOG_E(ENB_APP, " Can not start eNB register retry timer, use \"usleep\" instead!\n"); + LOG_E(ENB_APP, " Can not start eNB register retry timer, use \"sleep\" instead!\n"); - usleep(ENB_REGISTER_RETRY_DELAY * 1000000); + sleep(ENB_REGISTER_RETRY_DELAY); /* Restart the registration process */ registered_enb = 0; register_enb_pending = eNB_app_register (); @@ -441,7 +443,8 @@ void *eNB_app_task(void *args_p) break; } - itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); + result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); } while (1); #endif diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 8f5dcaa3a364d0e911b454d393a039f1993699d6..d6f36da61df52fedabfb0fddf0e57202f568e27c 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -36,6 +36,7 @@ */ +#include "assertions.h" #include "PHY/defs.h" #include "PHY/extern.h" @@ -4230,9 +4231,10 @@ void eNB_dlsch_ulsch_scheduler(u8 Mod_id,u8 cooperation_flag, u32 frame, u8 subf int ret; #endif #if defined(ENABLE_ITTI) - MessageDef *msg_p; - const char *msg_name; - instance_t instance; + MessageDef *msg_p; + const char *msg_name; + instance_t instance; + int result; #endif DCI_PDU *DCI_pdu= &eNB_mac_inst[Mod_id].DCI_pdu; @@ -4250,6 +4252,10 @@ void eNB_dlsch_ulsch_scheduler(u8 Mod_id,u8 cooperation_flag, u32 frame, u8 subf instance = ITTI_MSG_INSTANCE (msg_p); switch (ITTI_MSG_ID(msg_p)) { + case MESSAGE_TEST: + LOG_D(MAC, "Received %s\n", ITTI_MSG_NAME(msg_p)); + break; + case RRC_MAC_BCCH_DATA_REQ: LOG_D(MAC, "Received %s from %s: instance %d, frame %d, eNB_index %d\n", msg_name, ITTI_MSG_ORIGIN_NAME(msg_p), instance, @@ -4281,7 +4287,8 @@ void eNB_dlsch_ulsch_scheduler(u8 Mod_id,u8 cooperation_flag, u32 frame, u8 subf break; } - itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); + result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); } } while(msg_p != NULL); #endif diff --git a/openair2/LAYER2/MAC/ue_procedures.c b/openair2/LAYER2/MAC/ue_procedures.c index 32978e59964ec2e7a465d747b609fdb26886f92e..095c1e5aff98885a4d7c083052b275cbd5ca2483 100644 --- a/openair2/LAYER2/MAC/ue_procedures.c +++ b/openair2/LAYER2/MAC/ue_procedures.c @@ -1284,9 +1284,10 @@ UE_L2_STATE_t ue_scheduler(u8 Mod_id,u32 frame, u8 subframe, lte_subframe_t dire int ret; #endif #if defined(ENABLE_ITTI) - MessageDef *msg_p; - const char *msg_name; - instance_t instance; + MessageDef *msg_p; + const char *msg_name; + instance_t instance; + int result; #endif vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SCHEDULER, VCD_FUNCTION_IN); @@ -1315,7 +1316,8 @@ UE_L2_STATE_t ue_scheduler(u8 Mod_id,u32 frame, u8 subframe, lte_subframe_t dire break; } - itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); + result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); } } while(msg_p != NULL); #endif diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c index 6d2872b5290658ed038a28ca641119f7aab9dae8..36becf930b691b93e727ffde45adb861a9365584 100755 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c @@ -522,9 +522,10 @@ BOOL pdcp_data_ind(u8 eNB_id, u8 UE_id, u32_t frame, u8_t eNB_flag, u8_t MBMS_fl void pdcp_run (u32_t frame, u8 eNB_flag, u8 UE_index, u8 eNB_index) { //----------------------------------------------------------------------------- #if defined(ENABLE_ITTI) - MessageDef *msg_p; - const char *msg_name; - instance_t instance; + MessageDef *msg_p; + const char *msg_name; + instance_t instance; + int result; #endif vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_RUN, VCD_FUNCTION_IN); @@ -551,7 +552,8 @@ void pdcp_run (u32_t frame, u8 eNB_flag, u8 UE_index, u8 eNB_index) { RRC_DCCH_DATA_REQ (msg_p).sdu_p, RRC_DCCH_DATA_REQ (msg_p).mode); // Message buffer has been processed, free it now. - itti_free (ITTI_MSG_ORIGIN_ID(msg_p), RRC_DCCH_DATA_REQ (msg_p).sdu_p); + result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), RRC_DCCH_DATA_REQ (msg_p).sdu_p); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); break; default: @@ -559,7 +561,8 @@ void pdcp_run (u32_t frame, u8 eNB_flag, u8 UE_index, u8 eNB_index) { break; } - itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); + result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); } } while(msg_p != NULL); #endif diff --git a/openair2/RRC/LITE/rrc_UE.c b/openair2/RRC/LITE/rrc_UE.c index 6288574116b52da7ca31e867748e31b8cafbf7ce..73181953e0ce115fa1cafb5e7c70106781a0813b 100644 --- a/openair2/RRC/LITE/rrc_UE.c +++ b/openair2/RRC/LITE/rrc_UE.c @@ -36,6 +36,7 @@ */ +#include "assertions.h" #include "defs.h" #include "PHY/TOOLS/dB_routines.h" #include "extern.h" @@ -2404,11 +2405,12 @@ EXPORT_SYMBOL(Rlc_info_am_config); #if defined(ENABLE_ITTI) void *rrc_ue_task(void *args_p) { - MessageDef *msg_p; - const char *msg_name; - instance_t instance; + MessageDef *msg_p; + const char *msg_name; + instance_t instance; unsigned int Mod_id; - SRB_INFO *srb_info_p; + int result; + SRB_INFO *srb_info_p; itti_mark_task_ready (TASK_RRC_UE); @@ -2497,7 +2499,8 @@ void *rrc_ue_task(void *args_p) { RRC_DCCH_DATA_IND (msg_p).eNB_index); // Message buffer has been processed, free it now. - itti_free (ITTI_MSG_ORIGIN_ID(msg_p), RRC_DCCH_DATA_IND (msg_p).sdu_p); + result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), RRC_DCCH_DATA_IND (msg_p).sdu_p); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); break; # if defined(ENABLE_USE_MME) @@ -2609,6 +2612,7 @@ void *rrc_ue_task(void *args_p) { } itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); msg_p = NULL; } } diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index a6187a05d0c27e1219923f40a99db873d5e5b7ec..45ca87f643b1fa1f7cd5715287548395ee880755 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -3021,10 +3021,11 @@ int rrc_eNB_decode_dcch (u8 Mod_id, u32 frame, u8 Srb_id, u8 UE_index, #if defined(ENABLE_ITTI) /*------------------------------------------------------------------------------*/ void *rrc_enb_task(void *args_p) { - MessageDef *msg_p; - const char *msg_name; - instance_t instance; - SRB_INFO *srb_info_p; + MessageDef *msg_p; + const char *msg_name; + instance_t instance; + int result; + SRB_INFO *srb_info_p; itti_mark_task_ready (TASK_RRC_ENB); @@ -3067,7 +3068,8 @@ void *rrc_enb_task(void *args_p) { RRC_DCCH_DATA_IND (msg_p).sdu_size); // Message buffer has been processed, free it now. - itti_free (ITTI_MSG_ORIGIN_ID(msg_p), RRC_DCCH_DATA_IND (msg_p).sdu_p); + result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), RRC_DCCH_DATA_IND (msg_p).sdu_p); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); break; #if defined(ENABLE_USE_MME) @@ -3104,7 +3106,8 @@ void *rrc_enb_task(void *args_p) { break; } - itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); + result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); msg_p = NULL; } } diff --git a/targets/RTAI/USER/lte-enb.c b/targets/RTAI/USER/lte-enb.c index 6ea76d23dfade93483215cd1734a49f5d967c716..11e696a8722c21714ed381073abc5c957c1647e9 100644 --- a/targets/RTAI/USER/lte-enb.c +++ b/targets/RTAI/USER/lte-enb.c @@ -297,7 +297,8 @@ int dummy_tx_buffer[3840*4] __attribute__((aligned(16))); #if defined(ENABLE_ITTI) void *l2l1_task(void *arg) { - MessageDef *message_p = NULL; + MessageDef *message_p = NULL; + int result; itti_set_task_real_time(TASK_L2L1); itti_mark_task_ready(TASK_L2L1); @@ -306,7 +307,8 @@ void *l2l1_task(void *arg) /* Wait for the initialize message */ do { if (message_p != NULL) { - itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p); + result = itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); } itti_receive_msg (TASK_L2L1, &message_p); @@ -326,7 +328,8 @@ void *l2l1_task(void *arg) break; } } while (ITTI_MSG_ID(message_p) != INITIALIZE_MESSAGE); - itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p); + result = itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); } do { @@ -348,7 +351,8 @@ void *l2l1_task(void *arg) break; } - itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p); + result = itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); } while(1); return NULL; diff --git a/targets/RTAI/USER/lte-softmodem.c b/targets/RTAI/USER/lte-softmodem.c index cc7e6db927c4c1c9d0eae3d4473ca24f8817d655..42c6b557c0f0d5ca4b75687f8a9ef0173f00d30a 100644 --- a/targets/RTAI/USER/lte-softmodem.c +++ b/targets/RTAI/USER/lte-softmodem.c @@ -475,6 +475,7 @@ void *emos_thread (void *arg) void *l2l1_task(void *arg) { MessageDef *message_p = NULL; + int result; itti_set_task_real_time(TASK_L2L1); itti_mark_task_ready(TASK_L2L1); @@ -483,7 +484,8 @@ void *l2l1_task(void *arg) /* Wait for the initialize message */ do { if (message_p != NULL) { - itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p); + result = itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); } itti_receive_msg (TASK_L2L1, &message_p); @@ -503,7 +505,8 @@ void *l2l1_task(void *arg) break; } } while (ITTI_MSG_ID(message_p) != INITIALIZE_MESSAGE); - itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p); + result = itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); } do { @@ -525,7 +528,8 @@ void *l2l1_task(void *arg) break; } - itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p); + result = itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); } while(1); return NULL; diff --git a/targets/SIMU/USER/oaisim.c b/targets/SIMU/USER/oaisim.c index 99a79e5f0210a63cb3f4d8d4fa59af935ef731b0..ed2db3340f89c52309853b1362a4564ae45efe11 100644 --- a/targets/SIMU/USER/oaisim.c +++ b/targets/SIMU/USER/oaisim.c @@ -468,7 +468,8 @@ void *l2l1_task(void *args_p) { #if defined(ENABLE_ITTI) - MessageDef *message_p = NULL; + MessageDef *message_p = NULL; + int result; itti_mark_task_ready (TASK_L2L1); @@ -476,7 +477,8 @@ void *l2l1_task(void *args_p) { /* Wait for the initialize message */ do { if (message_p != NULL) { - itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p); + result = itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); } itti_receive_msg (TASK_L2L1, &message_p); @@ -501,7 +503,8 @@ void *l2l1_task(void *args_p) { break; } } while (ITTI_MSG_ID(message_p) != INITIALIZE_MESSAGE); - itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p); + result = itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); } #endif @@ -535,7 +538,8 @@ void *l2l1_task(void *args_p) { break; } - itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p); + result = itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); } } while(message_p != NULL); #endif