diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-08-30 19:07:58 +0200 |
---|---|---|
committer | Daniel Willmann <daniel@totalueberwachung.de> | 2011-11-04 12:27:13 +0100 |
commit | debc918dc41090a9fee1757b4c9b39cd1b791b4b (patch) | |
tree | 9d0bc72b25c03fdbabdf2bee4a492a1e4e0d6944 /openbsc/src | |
parent | 30ea0c252f4b2c50979b17cc7be47ac228ec36e0 (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.
Diffstat (limited to 'openbsc/src')
-rw-r--r-- | openbsc/src/libbsc/bsc_api.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/openbsc/src/libbsc/bsc_api.c b/openbsc/src/libbsc/bsc_api.c index d2965a247..db79eb6bc 100644 --- a/openbsc/src/libbsc/bsc_api.c +++ b/openbsc/src/libbsc/bsc_api.c @@ -136,8 +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 */ - lchan_release(conn->secondary_lchan, 0, 1); + /* + * 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); conn->secondary_lchan = NULL; /* inform them about the failure */ |