From 493110af7a836953a622dc1182293a64e2ce1ab3 Mon Sep 17 00:00:00 2001
From: Cedric Roux <cedric.roux@eurecom.fr>
Date: Thu, 12 Oct 2017 16:33:52 +0200
Subject: [PATCH] bugfix: fix schedule_SRS (not sure this is the correct
 solution)

---
 openair2/LAYER2/MAC/eNB_scheduler.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c
index 36e9419898a..d625508f6c9 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler.c
@@ -113,6 +113,9 @@ void schedule_SRS(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP)
 	  ul_req        = &RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body;
 
 
+          // drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet
+          if (mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED) continue;
+
 	  AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated != NULL, "physicalConfigDedicated is null for UE %d\n",UE_id);
 
 	  if ((soundingRS_UL_ConfigDedicated = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->soundingRS_UL_ConfigDedicated)!=NULL) {
-- 
GitLab