diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-09-16 22:49:37 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-09-16 22:50:19 +0800 |
commit | 1f69b4653b2ff73a2b9a0dcaab0bf4cef6d11d35 (patch) | |
tree | 760639af90c6e30d8adae0cdfa93c22a8819e247 /openbsc | |
parent | f11af07431c0b3c69e2fbdf1e7afee7fee787ce4 (diff) |
bsc: Fix the clear to release resources first, then set to NULL
This is fixing a crash reported by Nico. Somehow I staged an
unfinished version of this code. The crash should be gone.
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/src/bsc_api.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/openbsc/src/bsc_api.c b/openbsc/src/bsc_api.c index 576440f9d..ba6dd8852 100644 --- a/openbsc/src/bsc_api.c +++ b/openbsc/src/bsc_api.c @@ -189,20 +189,18 @@ int gsm0808_cipher_mode(struct gsm_subscriber_connection *conn, int cipher, */ int gsm0808_clear(struct gsm_subscriber_connection* conn) { - struct gsm_lchan *lchan; + if (conn->ho_lchan) + bsc_clear_handover(conn); + + if (conn->lchan) { + lchan_release(conn->lchan, 1, 0); + conn->lchan->conn = NULL; + } - lchan = conn->lchan; conn->lchan = NULL; conn->ho_lchan = NULL; conn->bts = NULL; - if (conn->ho_lchan) - bsc_clear_handover(conn); - if (conn->lchan) - lchan_release(lchan, 1, 0); - conn->lchan->conn = NULL; - conn->lchan = NULL; - return 0; } |