From 09a75009cecfc30b476f7968d2e6c8c133a49e07 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 27 Feb 2024 19:25:51 +0100 Subject: [PATCH] nr_fill_ulsch(): gracefully handle case of no ulsch found --- openair1/PHY/NR_TRANSPORT/nr_ulsch.c | 7 +++++-- openair1/PHY/NR_TRANSPORT/nr_ulsch.h | 2 -- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch.c index 7e7562ff22..bc3046c578 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch.c @@ -34,7 +34,7 @@ #include "PHY/NR_TRANSPORT/nr_transport_common_proto.h" #include "PHY/NR_TRANSPORT/nr_ulsch.h" -NR_gNB_ULSCH_t *find_nr_ulsch(PHY_VARS_gNB *gNB, uint16_t rnti, int pid) +static NR_gNB_ULSCH_t *find_nr_ulsch(PHY_VARS_gNB *gNB, uint16_t rnti, int pid) { int16_t first_free_index = -1; AssertFatal(gNB != NULL, "gNB is null\n"); @@ -62,7 +62,10 @@ void nr_fill_ulsch(PHY_VARS_gNB *gNB, int frame, int slot, nfapi_nr_pusch_pdu_t { int harq_pid = ulsch_pdu->pusch_data.harq_process_id; NR_gNB_ULSCH_t *ulsch = find_nr_ulsch(gNB, ulsch_pdu->rnti, harq_pid); - AssertFatal(ulsch, "No ulsch_id found for rnti %04x\n", ulsch_pdu->rnti); + if (ulsch == NULL) { + LOG_E(NR_PHY, "No ulsch_id found for rnti %04x\n", ulsch_pdu->rnti); + return; + } ulsch->rnti = ulsch_pdu->rnti; ulsch->harq_pid = harq_pid; diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch.h b/openair1/PHY/NR_TRANSPORT/nr_ulsch.h index 76fbb5da7f..817fe90931 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch.h +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch.h @@ -73,8 +73,6 @@ void nr_ulsch_unscrambling(int16_t* llr, uint32_t size, uint32_t Nid, uint32_t n void nr_ulsch_layer_demapping(int16_t *llr_cw, uint8_t Nl, uint8_t mod_order, uint32_t length, int16_t **llr_layers); -NR_gNB_ULSCH_t *find_nr_ulsch(PHY_VARS_gNB *gNB, uint16_t rnti, int pid); - void dump_pusch_stats(FILE *fd,PHY_VARS_gNB *gNB); void dump_nr_I0_stats(FILE *fd,PHY_VARS_gNB *gNB);