aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHolger Freyther <zecke@selfish.org>2009-06-02 02:54:57 +0000
committerHolger Freyther <zecke@selfish.org>2009-06-02 02:54:57 +0000
commitc21cfbc4aa07567751fb378b1ad0264936ffa2df (patch)
treeb0bafe5b1f547139a77f7f1176185691f9766857 /src
parent3e0ef7ccbec1949934c9a86c7711ec60052d727d (diff)
[subcriber] Fix the subscriber use counting in gsm_04_08.c (Andreas Eversberg)
This patch will fix subscriber usage countinig. It may happen, that the subscriber count will not be 0 after releasing of a call. (This problem is solved with the application patch (27), which will replace static call transaction by a dynamic transaction list, and use subscriber for each transaction created.)
Diffstat (limited to 'src')
-rw-r--r--src/gsm_04_08.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gsm_04_08.c b/src/gsm_04_08.c
index 07e7a4683..368b2f40e 100644
--- a/src/gsm_04_08.c
+++ b/src/gsm_04_08.c
@@ -851,6 +851,7 @@ static int gsm48_rx_mm_imsi_detach_ind(struct msgb *msg)
GSM_SUBSCRIBER_UPDATE_DETACHED);
DEBUGP(DMM, "Subscriber: %s\n",
subscr->name ? subscr->name : subscr->imsi);
+ subscr_put(subscr);
} else
DEBUGP(DMM, "Unknown Subscriber ?!?\n");
@@ -935,11 +936,16 @@ static int gsm48_rr_rx_pag_resp(struct msgb *msg)
DEBUGP(DRR, "<- Channel was requested by %s\n",
subscr->name ? subscr->name : subscr->imsi);
- if (!msg->lchan->subscr)
+ if (!msg->lchan->subscr) {
msg->lchan->subscr = subscr;
- else if (msg->lchan->subscr != subscr) {
+ } else if (msg->lchan->subscr != subscr) {
DEBUGP(DRR, "<- Channel already owned by someone else?\n");
subscr_put(subscr);
+ return -EINVAL;
+ } else {
+ DEBUGP(DRR, "<- Channel already owned by us\n");
+ subscr_put(subscr);
+ subscr = msg->lchan->subscr;
}
sig_data.subscr = subscr;