aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/bsc_api.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-12-26 22:12:53 +0100
committerHarald Welte <laforge@gnumonks.org>2011-01-01 17:28:49 +0100
commit6349b7f15ecdff83c95aeceddb46861b8d8433d3 (patch)
tree3d3facd64cbf18838dfc33078849b5aaff0aa942 /openbsc/src/bsc_api.c
parent624e89d3f70bdf8a84cff19cb9e19179d4f2f0bd (diff)
re-order the sequence of events in bsc_api:handle_release()
This should make sure conn->lchan is valid throughout the release cause, especially make trau_mux_unmap() happy that conn->lchan still exists.
Diffstat (limited to 'openbsc/src/bsc_api.c')
-rw-r--r--openbsc/src/bsc_api.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/openbsc/src/bsc_api.c b/openbsc/src/bsc_api.c
index 8e858c518..73b29b5ff 100644
--- a/openbsc/src/bsc_api.c
+++ b/openbsc/src/bsc_api.c
@@ -617,11 +617,6 @@ static void handle_release(struct gsm_subscriber_connection *conn,
{
int destruct = 1;
- /* now give up all channels */
- if (conn->lchan == lchan)
- conn->lchan = NULL;
- if (conn->ho_lchan == lchan)
- conn->ho_lchan = NULL;
if (conn->secondary_lchan == lchan) {
bsc_del_timer(&conn->T10);
conn->secondary_lchan = NULL;
@@ -631,12 +626,16 @@ static void handle_release(struct gsm_subscriber_connection *conn,
NULL);
}
- lchan->conn = NULL;
-
/* clear the connection now */
if (bsc->clear_request)
destruct = bsc->clear_request(conn, 0);
+ /* now give up all channels */
+ if (conn->lchan == lchan)
+ conn->lchan = NULL;
+ if (conn->ho_lchan == lchan)
+ conn->ho_lchan = NULL;
+ lchan->conn = NULL;
gsm0808_clear(conn);