TRX: Fix: Cleanly free TRX instances during initialization in case of an error

This commit is contained in:
Andreas Eversberg 2013-04-09 10:44:58 +02:00 committed by Harald Welte
parent c2ee307fd4
commit 82676c13ee
2 changed files with 4 additions and 3 deletions

View File

@ -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;
}

View File

@ -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;