From 698eff29f476a770dfdcb3359ecda62399dec6a3 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Mon, 27 Sep 2021 13:08:45 +0200 Subject: [PATCH] sched,nr: avoid ul pending bytes of each UE becoming negative --- srsenb/src/stack/mac/nr/sched_nr_ue.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/srsenb/src/stack/mac/nr/sched_nr_ue.cc b/srsenb/src/stack/mac/nr/sched_nr_ue.cc index bf7205bf8..476019230 100644 --- a/srsenb/src/stack/mac/nr/sched_nr_ue.cc +++ b/srsenb/src/stack/mac/nr/sched_nr_ue.cc @@ -135,6 +135,7 @@ void ue::new_slot(slot_point pdcch_slot) } } } + ul_pending_bytes = std::max(0, ul_pending_bytes); if (ul_pending_bytes == 0 and last_sr_slot.valid()) { // If unanswered SR is pending ul_pending_bytes = 512;