From d26c58940d4bc8f3743ee5fd7c72d9bf60fa83b0 Mon Sep 17 00:00:00 2001
From: knopp <knopp@mycompany.com>
Date: Tue, 23 Jun 2015 15:58:34 +0000
Subject: [PATCH] flagged an error condition in rx_ulsch which causes a divide
 by zero in signal_energy_nodc, function now returns with no result

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7643 818b1a75-f10b-46b9-bf7c-635c3b92a50f
---
 openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c
index 3ec50fda82..9c3fcae306 100644
--- a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c
+++ b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c
@@ -1616,6 +1616,11 @@ void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB,
 
   rx_power_correction = 1;
 
+  if (ulsch[UE_id]->harq_processes[harq_pid]->nb_rb == 0) {
+    LOG_E(PHY,"PUSCH (%d/%x) nb_rb=0!\n", harq_pid,ulsch[UE_id]->rnti,harq_pid);
+    return;
+  }
+
   for (l=0; l<(frame_parms->symbols_per_tti-ulsch[UE_id]->harq_processes[harq_pid]->srs_active); l++) {
 
 #ifdef DEBUG_ULSCH
-- 
GitLab