aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-12-27 10:57:56 +0100
committerHarald Welte <laforge@gnumonks.org>2010-12-27 10:59:34 +0100
commit41bbf6b12821ff43fbfde88d083962143cfae104 (patch)
tree25bb11d16608cd5c0faa60fb0602d974c53071f5
parent4a332e3282a680eae381bd5766a52731032819a0 (diff)
auth: Release the security operation after we sent out a message
The release might release the lchan we want to send the response on. Reorder the code to first send the message and then give up the security operation which might release the lchan.
-rw-r--r--openbsc/src/gsm_04_08.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/openbsc/src/gsm_04_08.c b/openbsc/src/gsm_04_08.c
index f141e1cd3..34e6ca20e 100644
--- a/openbsc/src/gsm_04_08.c
+++ b/openbsc/src/gsm_04_08.c
@@ -941,6 +941,7 @@ static int gsm48_rx_mm_auth_resp(struct gsm_subscriber_connection *conn, struct
/* Validate SRES */
if (memcmp(conn->sec_operation->atuple.sres, ar->sres,4)) {
+ int rc;
gsm_cbfn *cb = conn->sec_operation->cb;
DEBUGPC(DMM, "Invalid (expected %s)\n",
@@ -950,8 +951,9 @@ static int gsm48_rx_mm_auth_resp(struct gsm_subscriber_connection *conn, struct
cb(GSM_HOOK_RR_SECURITY, GSM_SECURITY_AUTH_FAILED,
NULL, conn, conn->sec_operation->cb_data);
+ rc = gsm48_tx_mm_auth_rej(conn);
release_security_operation(conn);
- return gsm48_tx_mm_auth_rej(conn);
+ return rc;
}
DEBUGPC(DMM, "OK\n");