diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2014-10-20 16:05:55 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-10-27 10:25:03 +0100 |
commit | ae20b4b31b679d7ea057f4db8427b99293068ec5 (patch) | |
tree | 5afbdc8089572335e1fbb57d12593b95c092019f /openbsc | |
parent | 19e990d6a7228e27afc86b2c686fe391cea9d770 (diff) |
sgsn: Cancel pending timer in sgsn_mm_ctx_free
Currently the timer is not stopped before the MM context is freed
which can lead to failure if sgsn_mm_ctx_free is called while timer
protected procedures are active.
This patch add code to cancel the timer if necessary from within
sgsn_mm_ctx_free.
Ticket: OW#1322
Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/src/gprs/gprs_sgsn.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c index ce9868e19..e68471313 100644 --- a/openbsc/src/gprs/gprs_sgsn.c +++ b/openbsc/src/gprs/gprs_sgsn.c @@ -180,6 +180,11 @@ void sgsn_mm_ctx_free(struct sgsn_mm_ctx *mm) { struct sgsn_pdp_ctx *pdp, *pdp2; + if (osmo_timer_pending(&mm->timer)) { + LOGMMCTXP(LOGL_INFO, mm, "Cancelling MM timer %u\n", mm->T); + osmo_timer_del(&mm->timer); + } + /* Unlink from global list of MM contexts */ llist_del(&mm->list); |