aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-11-05 13:58:32 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2018-11-21 17:59:06 +0100
commit77cd1129931928d2a6e7667d0374feeeed71b0ce (patch)
tree8c84de50c0ea0c9d6cd7960b78a447678a4e46d9 /src
parentc4ee002f2a8fdf57f42e19387ee27aab7b940f77 (diff)
gsm0408_rcvmsg: Release lchan if L3 fails to complete
gscon_release_lchans stub is added to gsm0408_test.c to make linker happy. Change-Id: I1743f9d5cd0fdbc0fb9afe7bcc0271c897915210
Diffstat (limited to 'src')
-rw-r--r--src/osmo-bsc/gsm_04_08_rr.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/osmo-bsc/gsm_04_08_rr.c b/src/osmo-bsc/gsm_04_08_rr.c
index 4659c1ac9..4be51981f 100644
--- a/src/osmo-bsc/gsm_04_08_rr.c
+++ b/src/osmo-bsc/gsm_04_08_rr.c
@@ -927,6 +927,7 @@ static void dispatch_dtap(struct gsm_subscriber_connection *conn,
int gsm0408_rcvmsg(struct msgb *msg, uint8_t link_id)
{
struct gsm_lchan *lchan;
+ int rc;
lchan = msg->lchan;
if (!lchan_may_receive_data(lchan)) {
@@ -948,7 +949,11 @@ int gsm0408_rcvmsg(struct msgb *msg, uint8_t link_id)
lchan->conn->lchan = lchan;
/* fwd via bsc_api to send COMPLETE L3 INFO to MSC */
- bsc_compl_l3(lchan->conn, msg, 0);
+ rc = bsc_compl_l3(lchan->conn, msg, 0);
+ if (rc < 0) {
+ gscon_release_lchans(lchan->conn, true);
+ return rc;
+ }
/* conn shall release lchan on teardown, also if this Layer 3 Complete is rejected. */
}