aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-07-11 13:19:22 +0600
committerPau Espin Pedrol <pespin@sysmocom.de>2021-07-12 18:05:42 +0200
commitdfd7bef6644d0c0837f7e5498bc5c86362b668dc (patch)
tree2ae4142f39c226156b6fde45983b007c6e96f8de
parente0c62bb9bdf8b110679979febca401cbc5f34311 (diff)
lchan_fsm: fix potential NULL-pointer dereference
-rw-r--r--src/osmo-bsc/lchan_fsm.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c
index 7b89b2db5..c9222c25d 100644
--- a/src/osmo-bsc/lchan_fsm.c
+++ b/src/osmo-bsc/lchan_fsm.c
@@ -142,9 +142,21 @@ static void _lchan_on_activation_failure(struct gsm_lchan *lchan, enum lchan_act
case ACTIVATE_FOR_ASSIGNMENT:
LOG_LCHAN(lchan, LOGL_NOTICE, "Signalling Assignment FSM of error (%s)\n",
lchan->last_error ? : "unknown error");
- _osmo_fsm_inst_dispatch(for_conn->assignment.fi, ASSIGNMENT_EV_LCHAN_ERROR, lchan,
- file, line);
- return;
+ if (!for_conn) {
+ LOG_LCHAN(lchan, LOGL_ERROR,
+ "lchan activation for Assignment failed, but activation request has"
+ " no conn\n");
+ break;
+ }
+ if (!for_conn->assignment.fi) {
+ LOG_LCHAN(lchan, LOGL_ERROR,
+ "lchan activation for Assignment failed, but conn has no ongoing"
+ " assignment procedure\n");
+ break;
+ }
+ _osmo_fsm_inst_dispatch(for_conn->assignment.fi, ASSIGNMENT_EV_LCHAN_ERROR,
+ lchan, file, line);
+ break;
case ACTIVATE_FOR_HANDOVER:
LOG_LCHAN(lchan, LOGL_NOTICE, "Signalling Handover FSM of error (%s)\n",