aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-01-16 09:17:24 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2013-01-16 09:19:34 +0100
commit0f4541b691fc1a2fffff2142f10620bb41f1f589 (patch)
tree76fa49bdf4fdae3b5837909516354841e01c3387
parent273a222d7f2d7d2ef2f17f753d16683bde4833a5 (diff)
Free each fl1h (sysmo-bts' layer 1 handler) when closing BTS<->PCU socket
-rw-r--r--src/sysmo_l1_if.c3
-rw-r--r--src/sysmo_sock.cpp8
2 files changed, 10 insertions, 1 deletions
diff --git a/src/sysmo_l1_if.c b/src/sysmo_l1_if.c
index 68881bf..2e1cb76 100644
--- a/src/sysmo_l1_if.c
+++ b/src/sysmo_l1_if.c
@@ -345,11 +345,12 @@ void *l1if_open_pdch(void *priv, uint32_t hlayer1)
return fl1h;
}
-static int l1if_close_pdch(void *obj)
+int l1if_close_pdch(void *obj)
{
struct femtol1_hdl *fl1h = obj;
if (fl1h)
l1if_transport_close(MQ_PDTCH_WRITE, fl1h);
+ talloc_free(fl1h);
return 0;
}
diff --git a/src/sysmo_sock.cpp b/src/sysmo_sock.cpp
index c456595..1982472 100644
--- a/src/sysmo_sock.cpp
+++ b/src/sysmo_sock.cpp
@@ -39,6 +39,10 @@ extern "C" {
extern void *tall_pcu_ctx;
+extern "C" {
+int l1if_close_pdch(void *obj);
+}
+
/*
* SYSMO-PCU socket functions
*/
@@ -95,6 +99,10 @@ static void pcu_sock_close(struct pcu_sock_state *state, int lost)
/* disable all slots, kick all TBFs */
for (trx = 0; trx < 8; trx++) {
+ if (bts->trx[trx].fl1h) {
+ l1if_close_pdch(bts->trx[trx].fl1h);
+ bts->trx[trx].fl1h = NULL;
+ }
for (ts = 0; ts < 8; ts++)
bts->trx[trx].pdch[ts].enable = 0;
for (tfi = 0; tfi < 32; tfi++) {