From e33c236db0e1b6986dee20d0614216b5c3147e6c Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Fri, 22 Jul 2022 03:44:44 +0700 Subject: [PATCH] {ms,gprs_pcu}_talloc_destructor(): call osmo_timer_del() unconditionally osmo_timer_del() does check if a timer is active internally. Change-Id: I062c7636b59714860fa6b49a2d59c6528ebd57e3 --- src/gprs_ms.c | 3 +-- src/gprs_pcu.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gprs_ms.c b/src/gprs_ms.c index 6daab319..3ed42445 100644 --- a/src/gprs_ms.c +++ b/src/gprs_ms.c @@ -142,8 +142,7 @@ static int ms_talloc_destructor(struct GprsMs *ms) ms_set_reserved_slots(ms, NULL, 0, 0); - if (osmo_timer_pending(&ms->timer)) - osmo_timer_del(&ms->timer); + osmo_timer_del(&ms->timer); if (ms->ul_tbf) { tbf_set_ms((struct gprs_rlcmac_tbf *)ms->ul_tbf, NULL); diff --git a/src/gprs_pcu.c b/src/gprs_pcu.c index ecb7f29b..de6b6691 100644 --- a/src/gprs_pcu.c +++ b/src/gprs_pcu.c @@ -65,8 +65,7 @@ static int gprs_pcu_talloc_destructor(struct gprs_pcu *pcu) while ((bts = llist_first_entry_or_null(&pcu->bts_list, struct gprs_rlcmac_bts, list))) talloc_free(bts); - if (osmo_timer_pending(&pcu->update_stats_timer)) - osmo_timer_del(&pcu->update_stats_timer); + osmo_timer_del(&pcu->update_stats_timer); neigh_cache_free(pcu->neigh_cache); si_cache_free(pcu->si_cache); return 0;