From e5900e0757341bd8d1ec46a02543a6a83cb6e7d8 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 4 Jul 2024 13:51:34 +0200 Subject: [PATCH] replacing assertions with LOG_E in UL locking mechanism --- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 20b0e80f61..c9f1656fb3 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -81,7 +81,10 @@ fapi_nr_ul_config_request_pdu_t *lockGet_ul_config(NR_UE_MAC_INST_t *mac, frame_ NR_TDD_UL_DL_ConfigCommon_t *tdd_config = mac->tdd_UL_DL_ConfigurationCommon; // Check if requested on the right slot - AssertFatal(is_nr_UL_slot(tdd_config, slot_tx, mac->frame_type) != 0, "UL config_request called at wrong slot %d\n", slot_tx); + if (!is_nr_UL_slot(tdd_config, slot_tx, mac->frame_type)) { + LOG_E(NR_MAC, "Lock of UL config for PDU type %d called for slot %d which is not UL\n", pdu_type, slot_tx); + return NULL; + } AssertFatal(mac->ul_config_request != NULL, "mac->ul_config_request not initialized, logic bug\n"); fapi_nr_ul_config_request_t *ul_config = mac->ul_config_request + slot_tx; @@ -220,7 +223,10 @@ fapi_nr_ul_config_request_pdu_t *lockGet_ul_iterator(NR_UE_MAC_INST_t *mac, fram { NR_TDD_UL_DL_ConfigCommon_t *tdd_config = mac->tdd_UL_DL_ConfigurationCommon; //Check if requested on the right slot - AssertFatal(is_nr_UL_slot(tdd_config, slot_tx, mac->frame_type) != 0, "UL config_request called at wrong slot %d\n", slot_tx); + if (!is_nr_UL_slot(tdd_config, slot_tx, mac->frame_type)) { + LOG_E(NR_MAC, "UL lock iterator called for slot %d which is not UL\n", slot_tx); + return NULL; + } AssertFatal(mac->ul_config_request != NULL, "mac->ul_config_request not initialized, logic bug\n"); return fapiLockIterator(mac->ul_config_request + slot_tx, frame_tx, slot_tx); }