diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-01-20 21:14:03 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-01-26 09:08:57 +0100 |
commit | e47d4f6d1187d453b846ea48f95ee75a42efc23b (patch) | |
tree | a98edfcf4fcb51609deed8e649b1af676ed981d8 /openbsc | |
parent | 81ffb740f78ccdada8ece786cfab852bc10172e8 (diff) |
sgsn: Remove MM from the list before gprs_subscr_delete is called
Modify sgsn_mm_ctx_free to remove the entry from the
list as otherwise we might double free the context from
within gprs_subscriber_delete.
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/src/gprs/gprs_sgsn.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c index 2b78d315c..acf37a28b 100644 --- a/openbsc/src/gprs/gprs_sgsn.c +++ b/openbsc/src/gprs/gprs_sgsn.c @@ -191,6 +191,9 @@ void sgsn_mm_ctx_free(struct sgsn_mm_ctx *mm) osmo_timer_del(&mm->timer); } + /* Unlink from global list of MM contexts */ + llist_del(&mm->list); + /* Detach from subscriber which is possibly freed then */ if (mm->subscr) { struct gsm_subscriber *subscr = mm->subscr; @@ -199,9 +202,6 @@ void sgsn_mm_ctx_free(struct sgsn_mm_ctx *mm) gprs_subscr_delete(subscr); } - /* Unlink from global list of MM contexts */ - llist_del(&mm->list); - /* Free all PDP contexts */ llist_for_each_entry_safe(pdp, pdp2, &mm->pdp_list, list) sgsn_pdp_ctx_free(pdp); |