Change in osmo-bsc[master]: fix handover start: dealloc ho if event not permitted

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Jul 19 16:28:56 UTC 2018


Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10056


Change subject: fix handover start: dealloc ho if event not permitted
......................................................................

fix handover start: dealloc ho if event not permitted

Before this, a handover request in a conn state that disallows it would leave a
lingering handover state in the conn, also thwarting any future handover
attempts. (It would be deallocated on conn teardown, so no memleak.)

Change-Id: I839a05495ae93c5dbbd1616efa2469e5b1990a61
---
M src/osmo-bsc/handover_logic.c
1 file changed, 9 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/56/10056/1

diff --git a/src/osmo-bsc/handover_logic.c b/src/osmo-bsc/handover_logic.c
index 960bf69..064615c 100644
--- a/src/osmo-bsc/handover_logic.c
+++ b/src/osmo-bsc/handover_logic.c
@@ -82,6 +82,7 @@
 int bsc_handover_start(enum hodec_id from_hodec_id, struct gsm_lchan *old_lchan, struct gsm_bts *new_bts,
 		       enum gsm_chan_t new_lchan_type)
 {
+	int rc;
 	struct gsm_subscriber_connection *conn;
 	struct bsc_handover *ho;
 	static uint8_t ho_ref = 0;
@@ -132,7 +133,14 @@
 	       gsm_lchant_name(new_lchan_type),
 	       do_assignment ? "Assignment" : "Handover");
 
-	return osmo_fsm_inst_dispatch(conn->fi, GSCON_EV_HO_START, NULL);
+	rc = osmo_fsm_inst_dispatch(conn->fi, GSCON_EV_HO_START, NULL);
+
+	if (rc < 0) {
+		LOGPHO(ho, LOGL_ERROR, "Failed to trigger handover, conn state does not allow it\n");
+		conn->ho = NULL;
+		talloc_free(ho);
+	}
+	return rc;
 }
 
 /*! Start actual handover. Call bsc_handover_start() instead; The only legal caller is the GSCON FSM in

-- 
To view, visit https://gerrit.osmocom.org/10056
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I839a05495ae93c5dbbd1616efa2469e5b1990a61
Gerrit-Change-Number: 10056
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180719/0d73f03a/attachment.htm>


More information about the gerrit-log mailing list