aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-04-09 10:44:58 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2014-04-06 08:58:03 +0200
commit4a346609a39feec11cc7b90258f6ca64f0ded802 (patch)
tree5ab9bf648a738286a5710a252f1d00ba9f1b2f61
parent38987eaa1161a0c569111a873d12c9ec6969bead (diff)
Fix: Cleanly free TRX instances during initialization in case of an error
-rw-r--r--src/osmo-bts-trx/l1_if.c1
-rw-r--r--src/osmo-bts-trx/trx_if.c6
2 files changed, 4 insertions, 3 deletions
diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index 676a6762..8b00856a 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -80,6 +80,7 @@ struct trx_l1h *l1if_open(struct gsm_bts_trx *trx)
err:
l1if_close(l1h);
+ trx->role_bts.l1h = NULL;
return NULL;
}
diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c
index e6b70134..1af10b5c 100644
--- a/src/osmo-bts-trx/trx_if.c
+++ b/src/osmo-bts-trx/trx_if.c
@@ -473,6 +473,9 @@ int trx_if_open(struct trx_l1h *l1h)
LOGP(DTRX, LOGL_NOTICE, "Open tranceiver for trx=%u\n", l1h->trx->nr);
+ /* initialize ctrl queue */
+ INIT_LLIST_HEAD(&l1h->trx_ctrl_list);
+
/* open sockets */
if (l1h->trx->nr == 0) {
rc = trx_udp_open(NULL, &trx_ofd_clk, base_port_local,
@@ -490,9 +493,6 @@ int trx_if_open(struct trx_l1h *l1h)
if (rc < 0)
goto err;
- /* initialize ctrl queue */
- INIT_LLIST_HEAD(&l1h->trx_ctrl_list);
-
/* enable all slots */
l1h->config.slotmask = 0xff;