Change in osmo-bts[master]: scheduler_trx: initalize n_errors, n_bursts_bits, n_bits_total

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/.

dexter gerrit-no-reply at lists.osmocom.org
Wed Oct 30 13:54:34 UTC 2019


dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/15908 )


Change subject: scheduler_trx: initalize n_errors, n_bursts_bits, n_bits_total
......................................................................

scheduler_trx: initalize n_errors, n_bursts_bits, n_bits_total

Make sure the variables n_errors, n_bursts_bits, n_bits_total are always
initalized. For example in rx_tchh_fn() the value for n_errors is
defined in a switch statement, where the default lets n_errors
uninitalized, which is in that particular case a theoretical problem,
however, lets make sure that the variables n_errors, n_bursts_bits and
n_bits_total are always initalized with 0

Related: CID#205452
Related: CID#205451
Change-Id: If28ea11cc111c7d73ca47b25e65ce399e5baa4c1
---
M src/osmo-bts-trx/scheduler_trx.c
1 file changed, 5 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/08/15908/1

diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 88e4f3a..2e97990 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -783,7 +783,7 @@
 	       uint8_t bid, const struct trx_ul_burst_ind *bi)
 {
 	struct osmo_phsap_prim l1sap;
-	int n_errors, n_bits_total;
+	int n_errors, n_bits_total = 0;
 	uint16_t ra11;
 	uint8_t ra;
 	int rc;
@@ -904,7 +904,7 @@
 	int32_t *ci_cb_sum = &chan_state->ci_cb_sum;
 	uint8_t *ci_cb_num = &chan_state->ci_cb_num;
 	uint8_t l2[GSM_MACBLOCK_LEN], l2_len;
-	int n_errors, n_bits_total;
+	int n_errors, n_bits_total = 0;
 	int16_t lqual_cb;
 	uint16_t ber10k;
 	int rc;
@@ -1020,7 +1020,7 @@
 	int32_t *ci_cb_sum = &chan_state->ci_cb_sum;
 	uint8_t *ci_cb_num = &chan_state->ci_cb_num;
 	uint8_t l2[EGPRS_0503_MAX_BYTES];
-	int n_errors, n_bursts_bits, n_bits_total;
+	int n_errors, n_bursts_bits, n_bits_total = 0;
 	int16_t lqual_cb;
 	uint16_t ber10k;
 	int rc;
@@ -1139,7 +1139,7 @@
 	uint8_t tch_mode = chan_state->tch_mode;
 	uint8_t tch_data[128]; /* just to be safe */
 	int rc, amr = 0;
-	int n_errors, n_bits_total;
+	int n_errors, n_bits_total = 0;
 	bool bfi_flag = false;
 	struct gsm_lchan *lchan =
 		get_lchan_by_chan_nr(l1t->trx, trx_chan_desc[chan].chan_nr | bi->tn);
@@ -1335,7 +1335,7 @@
 	uint8_t tch_mode = chan_state->tch_mode;
 	uint8_t tch_data[128]; /* just to be safe */
 	int rc, amr = 0;
-	int n_errors, n_bits_total;
+	int n_errors, n_bits_total = 0;
 	bool bfi_flag = false;
 	struct gsm_lchan *lchan =
 		get_lchan_by_chan_nr(l1t->trx, trx_chan_desc[chan].chan_nr | bi->tn);

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/15908
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: If28ea11cc111c7d73ca47b25e65ce399e5baa4c1
Gerrit-Change-Number: 15908
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191030/0a69ed1b/attachment.htm>


More information about the gerrit-log mailing list