summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-08-30 19:07:58 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-08-30 19:13:22 +0200
commitcab0d7bedc7d4a78c2ace645c5a3c94702d5bb40 (patch)
treeaac60b98f6379042a0cb808a7aff6f1eba16517a
parentb4d913d336d7a52dff840378726b1d3dc5f81268 (diff)
bsc: Fix a crash in case we get a NACK from the BTS for a new channel
In case of a nack the secondary_lchan will be NULLed but then the T10 timeout will attempt to release the channel and we will try to release a NULL pointer. Daniel witnessed this crash at the camp and added the NULL check at: 28d9ccbca0cb522c90f551cf4bf243acab7a1944, it is also the proper fix given the _NAK handling.
-rw-r--r--openbsc/src/libbsc/bsc_api.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/openbsc/src/libbsc/bsc_api.c b/openbsc/src/libbsc/bsc_api.c
index df81d49ab..8ddbc6cd3 100644
--- a/openbsc/src/libbsc/bsc_api.c
+++ b/openbsc/src/libbsc/bsc_api.c
@@ -136,12 +136,12 @@ static void assignment_t10_timeout(void *_conn)
LOGP(DMSC, LOGL_ERROR, "Assigment T10 timeout on %p\n", conn);
- /* normal release on the secondary channel */
- if (conn->secondary_lchan) {
+ /*
+ * normal release on the secondary channel but only if the
+ * secondary_channel has not been released by the handle_chan_nack.
+ */
+ if (conn->secondary_lchan)
lchan_release(conn->secondary_lchan, 0, 1);
- } else {
- LOGP(DMSC, LOGL_NOTICE, "Secondary lchan is NULL, not releasing\n");
- }
conn->secondary_lchan = NULL;
/* inform them about the failure */