aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-trx
diff options
context:
space:
mode:
authorIvan Klyuchnikov <kluchnikovi@gmail.com>2017-01-26 14:42:18 +0000
committerIvan Kluchnikov <kluchnikovi@gmail.com>2017-02-10 13:37:50 +0000
commit0418ef588cddd9ae06e7505890ed028b17f9abce (patch)
treebcc7a836f7fda3116ce086c2fc08188df566bdf1 /src/osmo-bts-trx
parente2e0ed5a8962cd465fd5394815af20a46a1d23d2 (diff)
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
Diffstat (limited to 'src/osmo-bts-trx')
-rw-r--r--src/osmo-bts-trx/l1_if.c3
-rw-r--r--src/osmo-bts-trx/main.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index 8c5115b8..6c1969c4 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -66,10 +66,9 @@ struct trx_l1h *l1if_open(struct phy_instance *pinst)
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 dbd8fc4d..98066cab 100644
--- a/src/osmo-bts-trx/main.c
+++ b/src/osmo-bts-trx/main.c
@@ -121,6 +121,10 @@ void bts_model_phy_link_set_defaults(struct phy_link *plink)
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)