diff options
authorNeels Hofmeyr <neels@hofmeyr.de>2020-08-19 13:40:33 +0000
committerPau Espin Pedrol <pespin@sysmocom.de>2020-09-09 16:27:54 +0200
commit602c092c73493a78d4ec4427fb2e8e1a9f3c7561 (patch)
parente013b3b1eb57250befb53445f82e2e732fcbf37a (diff)
fix crash for unknown MI during Paging Response
This patch is a cherry-pick from master's 667d5e0b95d01946ba5e80ae7e202576c05cc5c1, to create a new patch release to avoid osmo-msc crash during ttcn3-msc-tests-latest run. Related: OS#4724 Related: I40496bbccbbd9c496cfa57df49e26f124a2b1554 (osmo-ttcn3-hacks) Change-Id: Ia2c8fa745cfab17ed7114d433f625ddc02ae7b11
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c
index b284ccd7a..3594bfc79 100644
--- a/src/libmsc/gsm_04_08.c
+++ b/src/libmsc/gsm_04_08.c
@@ -1185,7 +1185,12 @@ static int gsm48_rx_rr_pag_resp(struct msc_a *msc_a, struct msgb *msg)
vsub = msc_a_vsub(msc_a);
if (!vsub) {
LOG_MSC_A(msc_a, LOGL_ERROR, "subscriber not allowed to do a Paging Response\n");
- msc_a_put(msc_a, MSC_A_USE_PAGING_RESPONSE);
+ /* Above MSC_A_USE_PAGING_RESPONSE may already have been removed by a forced release, put that use only
+ * if it still exists. (see msc_a_fsm_releasing_onenter()) */
+ if (osmo_use_count_by(&msc_a->use_count, MSC_A_USE_PAGING_RESPONSE))
+ msc_a_put(msc_a, MSC_A_USE_PAGING_RESPONSE);
return -EIO;