From c21cfbc4aa07567751fb378b1ad0264936ffa2df Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Tue, 2 Jun 2009 02:54:57 +0000 Subject: [PATCH] [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.) --- src/gsm_04_08.c | 10 ++++++++-- 1 file 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;