From ebd50a6fd23c630ae9db13851b986fa7aebc2f62 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 27 Dec 2010 13:46:48 +0100 Subject: bsc: Clear the hand-over in case the new_lchan is failing When the new_lchan for handover is failing we should stop the handover operation. This is fixing a crash that we get a timeout on the lchan and have no conn set to it. Introduce a flag to the bsc_clear_handover to not free the lchan. In case the ho_lchan is failing we do not want to call lchan_release as it would reset the state. --- openbsc/src/handover_logic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'openbsc/src/handover_logic.c') diff --git a/openbsc/src/handover_logic.c b/openbsc/src/handover_logic.c index 44a69331c..c2e3f8c72 100644 --- a/openbsc/src/handover_logic.c +++ b/openbsc/src/handover_logic.c @@ -149,7 +149,7 @@ int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts) return 0; } -void bsc_clear_handover(struct gsm_subscriber_connection *conn) +void bsc_clear_handover(struct gsm_subscriber_connection *conn, int free_lchan) { struct bsc_handover *ho; @@ -166,7 +166,9 @@ void bsc_clear_handover(struct gsm_subscriber_connection *conn) conn->ho_lchan->conn = NULL; conn->ho_lchan = NULL; - lchan_release(ho->new_lchan, 0, 1); + + if (free_lchan) + lchan_release(ho->new_lchan, 0, 1); bsc_del_timer(&ho->T3103); llist_del(&ho->list); -- cgit v1.2.3