summaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-04-06 16:54:55 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-04-29 18:53:27 +0200
commit0ae564d9b1fcee46cd77ccc83c570376d0526c8c (patch)
tree514b6962e6c8e27788b23184f2977e56bf651e36 /openbsc
parent1e28eb83c0c2f1b362114199e70b6d454fa2d08b (diff)
sub: Remove paging requests before dispatching
The dispatching might lead to the removal of more paging requests and makes "request" invalid. Remove it before calling the callback.
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/libbsc/paging.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/openbsc/src/libbsc/paging.c b/openbsc/src/libbsc/paging.c
index 2d08af78a..8bc10e670 100644
--- a/openbsc/src/libbsc/paging.c
+++ b/openbsc/src/libbsc/paging.c
@@ -366,13 +366,19 @@ static void _paging_request_stop(struct gsm_bts *bts, struct gsm_subscriber *sub
llist_for_each_entry_safe(req, req2, &bts_entry->pending_requests,
entry) {
if (req->subscr == subscr) {
- if (conn && req->cbfn) {
+ gsm_cbfn *cbfn = req->cbfn;
+ void *param = req->cbfn_param;
+
+ /* now give up the data structure */
+ paging_remove_request(&bts->paging, req);
+ req = NULL;
+
+ if (conn && cbfn) {
LOGP(DPAG, LOGL_DEBUG, "Stop paging on bts %d, calling cbfn.\n", bts->nr);
- req->cbfn(GSM_HOOK_RR_PAGING, GSM_PAGING_SUCCEEDED,
- msg, conn, req->cbfn_param);
+ cbfn(GSM_HOOK_RR_PAGING, GSM_PAGING_SUCCEEDED,
+ msg, conn, param);
} else
LOGP(DPAG, LOGL_DEBUG, "Stop paging on bts %d silently.\n", bts->nr);
- paging_remove_request(&bts->paging, req);
break;
}
}