[MERGED] osmo-bts[master]: osmo-trx-bts: Fix osmo-bts-trx crash on startup during readi...

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

Ivan Kluchnikov gerrit-no-reply at lists.osmocom.org
Fri Feb 10 13:38:08 UTC 2017


Ivan Kluchnikov has submitted this change and it was merged.

Change subject: osmo-trx-bts: Fix osmo-bts-trx crash on startup during reading phy instance parameters from config file
......................................................................


osmo-trx-bts: Fix osmo-bts-trx crash on startup during reading phy instance parameters from config file

pinst->u.osmotrx.hdl should be allocated before reading phy_instance parameters from config file and applying them.
So allocation of pinst->u.osmotrx.hdl should be moved from l1if_open function to bts_model_phy_instance_set_defaults function,
which is proper place for this allocation according to start-up procedure of osmo-bts.

Change-Id: I6e23f92644400acb268818c9373a8fb10c003da1
---
M src/osmo-bts-trx/l1_if.c
M src/osmo-bts-trx/main.c
2 files changed, 5 insertions(+), 2 deletions(-)

Approvals:
  Max: Looks good to me, but someone else must approve
  Ivan Kluchnikov: Verified
  Harald Welte: Looks good to me, approved



diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index 8c5115b..6c1969c 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -66,10 +66,9 @@
 	struct trx_l1h *l1h;
 	int rc;
 
-	l1h = talloc_zero(tall_bts_ctx, struct trx_l1h);
+	l1h = pinst->u.osmotrx.hdl;
 	if (!l1h)
 		return NULL;
-	l1h->phy_inst = pinst;
 
 	rc = trx_sched_init(&l1h->l1s, pinst->trx);
 	if (rc < 0) {
diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c
index dbd8fc4..98066ca 100644
--- a/src/osmo-bts-trx/main.c
+++ b/src/osmo-bts-trx/main.c
@@ -121,6 +121,10 @@
 
 void bts_model_phy_instance_set_defaults(struct phy_instance *pinst)
 {
+	struct trx_l1h *l1h;
+	l1h = talloc_zero(tall_bts_ctx, struct trx_l1h);
+	l1h->phy_inst = pinst;
+	pinst->u.osmotrx.hdl = l1h;
 }
 
 int main(int argc, char **argv)

-- 
To view, visit https://gerrit.osmocom.org/1786
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6e23f92644400acb268818c9373a8fb10c003da1
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Ivan Kluchnikov <kluchnikovi at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Ivan Kluchnikov <kluchnikovi at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>



More information about the gerrit-log mailing list