aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-08-26 07:55:26 +0200
committerHarald Welte <laforge@gnumonks.org>2011-08-26 07:55:26 +0200
commitf350e253948527290e78748a270dcf1613b1271c (patch)
treefc12e282141ce972957b62098e92712d1ba2b1d4
parentcfc9f1f7cc199d2d61e27f0a0b76c4e170435ec6 (diff)
lapd: stop timers in lapd_instance_free()
-rw-r--r--src/input/lapd.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/input/lapd.c b/src/input/lapd.c
index d94af58..be011af 100644
--- a/src/input/lapd.c
+++ b/src/input/lapd.c
@@ -733,6 +733,17 @@ struct lapd_instance *lapd_instance_alloc(int network_side,
void lapd_instance_free(struct lapd_instance *li)
{
+ struct lapd_tei *lt;
+
+ /* make sure to terminate any pending timers */
+ llist_for_each_entry(lt, &li->tei_list, list) {
+ struct lapd_sap *sap;
+ llist_for_each_entry(sap, &lt->sap_list, list) {
+ if (osmo_timer_pending(&sap->sabme_timer))
+ osmo_timer_del(&sap->sabme_timer);
+ }
+ }
+
/* tei and sapis are allocated hierarchically of the lapd
* instance, so one free is sufficient here */
talloc_free(li);