aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-12-27 22:43:28 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-01-06 14:52:51 +0100
commit725966d9b4f69ae61763eb08fc5708198c4bf739 (patch)
tree38509c5e68755c47b6606c37fa9371c95d35aa01 /openbsc/src
parent8e3eb584a8c91fc9e6b0d06e2345812894d3186d (diff)
subscr: Make the subscr_put_channel work with the subscr
The active channel might or might not be gone when the transaction has been released. Instead of passing an invalid subscriber conn we will pass the subscr that is ref-counted and guranteed to be valid at this point. subscr_put_channel could search the connections for an active connection if that is ever needed.
Diffstat (limited to 'openbsc/src')
-rw-r--r--openbsc/src/gsm_04_11.c7
-rw-r--r--openbsc/src/gsm_subscriber.c6
2 files changed, 8 insertions, 5 deletions
diff --git a/openbsc/src/gsm_04_11.c b/openbsc/src/gsm_04_11.c
index 6c17492d9..bb43196b7 100644
--- a/openbsc/src/gsm_04_11.c
+++ b/openbsc/src/gsm_04_11.c
@@ -139,7 +139,7 @@ static void gsm411_release_conn(struct gsm_subscriber_connection *conn)
if (!conn)
return;
- subscr_put_channel(conn);
+ subscr_put_channel(conn->subscr);
}
struct msgb *gsm411_msgb_alloc(void)
@@ -1186,8 +1186,10 @@ void _gsm411_sms_trans_free(struct gsm_trans *trans)
void gsm411_sapi_n_reject(struct gsm_subscriber_connection *conn)
{
+ struct gsm_subscriber *subscr;
struct gsm_trans *trans, *tmp;
+ subscr = subscr_get(conn->subscr);
llist_for_each_entry_safe(trans, tmp, &conn->bts->network->trans_list, entry)
if (trans->conn == conn) {
struct gsm_sms *sms = trans->sms.sms;
@@ -1202,6 +1204,7 @@ void gsm411_sapi_n_reject(struct gsm_subscriber_connection *conn)
trans_free(trans);
}
- gsm411_release_conn(conn);
+ subscr_put_channel(subscr);
+ subscr_put(subscr);
}
diff --git a/openbsc/src/gsm_subscriber.c b/openbsc/src/gsm_subscriber.c
index e44029c30..34163da4b 100644
--- a/openbsc/src/gsm_subscriber.c
+++ b/openbsc/src/gsm_subscriber.c
@@ -208,7 +208,7 @@ void subscr_get_channel(struct gsm_subscriber *subscr,
}
}
-void subscr_put_channel(struct gsm_subscriber_connection *conn)
+void subscr_put_channel(struct gsm_subscriber *subscr)
{
/*
* FIXME: Continue with other requests now... by checking
@@ -228,8 +228,8 @@ void subscr_put_channel(struct gsm_subscriber_connection *conn)
* will listen to the paging requests before we timeout
*/
- if (conn->subscr && !llist_empty(&conn->subscr->requests))
- subscr_send_paging_request(conn->subscr);
+ if (subscr && !llist_empty(&subscr->requests))
+ subscr_send_paging_request(subscr);
}