aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-12-26 22:12:53 +0100
committerHarald Welte <laforge@gnumonks.org>2010-12-26 22:12:53 +0100
commit59d603fcc40f7a0b5cbb822ae4bc1b1a5ba4cf2d (patch)
tree963636d28d54c522f1d87d7b8a1afd73fe0d7a2f
parent5ccd3221da19276c8b3d9225033ac91bf29190af (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.
-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 d7be9e44c..68a9de6dd 100644
--- a/openbsc/src/bsc_api.c
+++ b/openbsc/src/bsc_api.c
@@ -605,11 +605,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;
@@ -619,12 +614,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);