From 9a55658b57bef2edf3b4319d2933090cba5bf63f Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 20 Jul 2023 13:21:27 +0200 Subject: [PATCH] Fix bug in scheduler lock mechanism nr_mac_prepare_ra_ue() is called with the scheduler being locked via NR_SCHED_ENSURE_LOCKED(), but if there is no free RA process, it unlocks the scheduler via NR_SCHED_UNLOCK(). This is commit fixes this. In short, when calling nr_mac_prepare_ra_ue(), the scheduler is locked, and should always return with the scheduler being locked. --- openair2/LAYER2/NR_MAC_gNB/config.c | 1 - 1 file changed, 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 39f72831f4..5b91dadca6 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -594,7 +594,6 @@ bool nr_mac_prepare_ra_ue(gNB_MAC_INST *nrmac, uint32_t rnti, NR_CellGroupConfig } if (ra_index == NR_NB_RA_PROC_MAX) { LOG_E(NR_MAC, "RA processes are not available for CFRA RNTI %04x\n", rnti); - NR_SCHED_UNLOCK(&nrmac->sched_lock); return false; } NR_RA_t *ra = &cc->ra[ra_index];