From f1cb44a0057e7814145cc83469f34677bba090b9 Mon Sep 17 00:00:00 2001
From: Robert Schmidt <robert.schmidt@eurecom.fr>
Date: Fri, 29 Jan 2021 09:31:56 +0100
Subject: [PATCH] Bugfix: decrease actual MCS value

---
 openair2/LAYER2/MAC/pre_processor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c
index e720c1dfec..bf8202f622 100644
--- a/openair2/LAYER2/MAC/pre_processor.c
+++ b/openair2/LAYER2/MAC/pre_processor.c
@@ -734,7 +734,7 @@ void calculate_max_mcs_min_rb(module_id_t mod_id,
 
   /* find maximum MCS */
   while ((phr - *tx_power < 0 || tbs > bytes) && *mcs > 3) {
-    mcs--;
+    (*mcs)--;
     tbs = get_TBS_UL(*mcs, rb_table[*rb_index]);
     *tx_power = estimate_ue_tx_power(tbs * 8, rb_table[*rb_index], 0, Ncp, 0);
   }
-- 
2.26.2