pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27934 )
Change subject: bts: Make sure paging timers are deleted when struct gsm_bts is freed ......................................................................
bts: Make sure paging timers are deleted when struct gsm_bts is freed
Change-Id: If8dffc948a3a9d8bdd9237f644e7f10f41c64853 --- M include/osmocom/bsc/paging.h M src/osmo-bsc/bts.c M src/osmo-bsc/paging.c 3 files changed, 10 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/34/27934/1
diff --git a/include/osmocom/bsc/paging.h b/include/osmocom/bsc/paging.h index c4381fa..593529d 100644 --- a/include/osmocom/bsc/paging.h +++ b/include/osmocom/bsc/paging.h @@ -110,6 +110,7 @@ };
void paging_init(struct gsm_bts *bts); +void paging_destructor(struct gsm_bts *bts);
/* schedule paging request */ int paging_request_bts(const struct bsc_paging_params *params, struct gsm_bts *bts); diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c index a596523..831c5eb 100644 --- a/src/osmo-bsc/bts.c +++ b/src/osmo-bsc/bts.c @@ -149,6 +149,8 @@
static int gsm_bts_talloc_destructor(struct gsm_bts *bts) { + paging_destructor(bts); + bts->site_mgr->bts[0] = NULL;
if (bts->gprs.cell.mo.fi) { diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c index 3275473..c0649da 100644 --- a/src/osmo-bsc/paging.c +++ b/src/osmo-bsc/paging.c @@ -266,6 +266,13 @@ osmo_timer_setup(&bts->paging.credit_timer, paging_give_credit, &bts->paging); }
+/* Called upon the bts struct being freed */ +void paging_destructor(struct gsm_bts *bts) +{ + osmo_timer_del(&bts->paging.credit_timer); + osmo_timer_del(&bts->paging.work_timer); +} + /*! Call-back once T3113 (paging timeout) expires for given paging_request */ static void paging_T3113_expired(void *data) {