[PATCH 1/2] LAPD: Add function to release/free a LAPD instance

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Harald Welte laforge at gnumonks.org
Wed Aug 24 07:45:11 UTC 2011


---
 include/osmocom/abis/lapd.h |    1 +
 src/input/lapd.c            |    7 +++++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/include/osmocom/abis/lapd.h b/include/osmocom/abis/lapd.h
index dd22028..92dc2c3 100644
--- a/include/osmocom/abis/lapd.h
+++ b/include/osmocom/abis/lapd.h
@@ -48,6 +48,7 @@ struct lapd_instance *lapd_instance_alloc(int network_side,
 					  void (*tx_cb)(uint8_t *data, int len,
 							void *cbdata), void *cbdata);
 
+void lapd_instance_free(struct lapd_instance *li);
 
 /* Start a (user-side) SAP for the specified TEI/SAPI on the LAPD instance */
 int lapd_sap_start(struct lapd_instance *li, uint8_t tei, uint8_t sapi);
diff --git a/src/input/lapd.c b/src/input/lapd.c
index 0287e14..d94af58 100644
--- a/src/input/lapd.c
+++ b/src/input/lapd.c
@@ -730,3 +730,10 @@ struct lapd_instance *lapd_instance_alloc(int network_side,
 
 	return li;
 }
+
+void lapd_instance_free(struct lapd_instance *li)
+{
+	/* tei and sapis are allocated hierarchically of the lapd
+	 * instance, so one free is sufficient here */
+	talloc_free(li);
+}
-- 
1.7.5.4


--oJ71EGRlYNjSvfq7
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0002-DAHDI-Make-sure-dahdi_e1_setup-can-be-called-multipl.patch"



More information about the OpenBSC mailing list