Change in osmocom-bb[master]: trxcon/scheduler: fix: prevent division by zero

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Sat Sep 29 16:30:48 UTC 2018


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/11157


Change subject: trxcon/scheduler: fix: prevent division by zero
......................................................................

trxcon/scheduler: fix: prevent division by zero

Change-Id: Id4659de899411ec1ba1718fdcb40aec562dbfd65
---
M src/host/trxcon/sched_lchan_common.c
1 file changed, 2 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/57/11157/1

diff --git a/src/host/trxcon/sched_lchan_common.c b/src/host/trxcon/sched_lchan_common.c
index 95e496b..62ec0f7 100644
--- a/src/host/trxcon/sched_lchan_common.c
+++ b/src/host/trxcon/sched_lchan_common.c
@@ -96,8 +96,9 @@
 	dl_hdr.link_id = lchan_desc->link_id;
 	dl_hdr.band_arfcn = htons(trx->band_arfcn);
 	dl_hdr.frame_nr = htonl(lchan->rx_first_fn);
-	dl_hdr.rx_level = -(lchan->meas.rssi_sum / lchan->meas.rssi_num);
 	dl_hdr.num_biterr = bit_error_count;
+	dl_hdr.rx_level = lchan->meas.rssi_num ?
+		-(lchan->meas.rssi_sum / lchan->meas.rssi_num) : 0;
 
 	/* FIXME: set proper values */
 	dl_hdr.snr = 0;

-- 
To view, visit https://gerrit.osmocom.org/11157
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id4659de899411ec1ba1718fdcb40aec562dbfd65
Gerrit-Change-Number: 11157
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180929/fc21d607/attachment.htm>


More information about the gerrit-log mailing list