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.
This commit is contained in:
Harald Welte 2010-12-26 22:12:53 +01:00
parent 624e89d3f7
commit 6349b7f15e
1 changed files with 6 additions and 7 deletions

View File

@ -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);