paging: paging_flush_bts: be sure pending_requests is initalized

The BSSMAP reset causes the paging requests to be flushed. When
this happens right after startup then calling paging_flush_bts()
may be called when the list bts->paging.pending_requests is not
yet initalized, which causes a segfault.

Call paging_init_if_needed() to be sure that the list is
inizalized (like the other functions also do)

Change-Id: I42ddbfdec6f9d74d858ad13cc38b5b64061d08dc
This commit is contained in:
Philipp Maier 2017-12-13 15:33:25 +01:00 committed by Harald Welte
parent 719322693c
commit 256d09d1f2
1 changed files with 2 additions and 0 deletions

View File

@ -477,6 +477,8 @@ void paging_flush_bts(struct gsm_bts *bts, struct bsc_msc_data *msc)
{
struct gsm_paging_request *req, *req2;
paging_init_if_needed(bts);
llist_for_each_entry_safe(req, req2, &bts->paging.pending_requests, entry) {
if (msc && req->msc != msc)
continue;