aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2009-12-18 18:28:10 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2009-12-19 03:22:25 +0100
commitea3f674710c8fab1bf06150b4cba67e139b5e04e (patch)
tree22607682f32c2bf671af48dfbbd2782831133c9e /openbsc
parentfeaca92fc0dde67f392e1245a6fe0ea52d1022d5 (diff)
Fix subscr ref leak for multi CM SERV REQ
Multiple CM SERVICE REQUEST can happen on a single RR connection, in this case, since the subscr reference is tracked through lchan->subscr and will only be put'd once on lchan_free, we need to make sure we don't get several reference .... Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Diffstat (limited to 'openbsc')
-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 5fea6bfbf..f87b3358f 100644
--- a/openbsc/src/gsm_04_08.c
+++ b/openbsc/src/gsm_04_08.c
@@ -1343,7 +1343,9 @@ static int gsm48_rx_mm_serv_req(struct msgb *msg)
if (!msg->lchan->subscr)
msg->lchan->subscr = subscr;
- else if (msg->lchan->subscr != subscr) {
+ else if (msg->lchan->subscr == subscr)
+ subscr_put(subscr); /* lchan already has a ref, don't need another one */
+ else {
DEBUGP(DMM, "<- CM Channel already owned by someone else?\n");
subscr_put(subscr);
}