From 628a05e738b5f37e2fecd544780240e56db54036 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Tue, 7 Aug 2018 11:31:51 +0200 Subject: GSCON: call api of a_reset.c with msc object directly The API of a_reset.c is currently called with a pointer to struct reset_ctx. This puts the responsibility of checking the presence of msc->a.reset_fsm to the caller. It would be much more effective if the caller would check if msc->a.reset_fsm before dereferencing it. This also fixes at least one segfault that ocurrs when gscon_timer_cb() is called but no sccp connection is present yet. Therefore the pointer to bsc_msc_data would not be populated. This is now detected by a_reset.c itsself. - minor code cleanups - call a_reset.c functions with msc (struct bsc_msc_data) Change-Id: I0802aaadf0af4e58e41c98999e8c6823838adb61 Related: OS#3447 --- src/osmo-bsc/bsc_subscr_conn_fsm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/osmo-bsc/bsc_subscr_conn_fsm.c') diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c index 81fe9f6cc..32375d47f 100644 --- a/src/osmo-bsc/bsc_subscr_conn_fsm.c +++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c @@ -771,7 +771,7 @@ static int gscon_timer_cb(struct osmo_fsm_inst *fi) * could indicate a bad SCCP connection. We now inform the the * FSM that controls the BSSMAP reset about the event. Maybe * a BSSMAP reset is necessary. */ - a_reset_conn_fail(conn->sccp.msc->a.reset_fsm); + a_reset_conn_fail(conn->sccp.msc); /* Since we could not reach the MSC, we give up and terminate * the FSM instance now (N-DISCONNET.req is sent in @@ -783,7 +783,7 @@ static int gscon_timer_cb(struct osmo_fsm_inst *fi) * disconnected. */ LOGPFSML(fi, LOGL_ERROR, "Long after a BSSMAP Clear Command, the conn is still not" " released. For sanity, discarding this conn now.\n"); - a_reset_conn_fail(conn->sccp.msc->a.reset_fsm); + a_reset_conn_fail(conn->sccp.msc); osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); break; default: -- cgit v1.2.3