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

Max gerrit-no-reply at lists.osmocom.org
Thu Feb 9 18:47:50 UTC 2017

Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit


to look at the new patch set (#2).

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(-)

  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/86/1786/2

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: newpatchset
Gerrit-Change-Id: I6e23f92644400acb268818c9373a8fb10c003da1
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: 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