aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/bsc_api.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-11-14 15:50:42 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-11-15 20:06:47 +0100
commita2828fa4bcd3f4245da33c7929bcef0f161317d4 (patch)
treef23b47a2a6b618dc6f3b0c30e9d482d3c8057cc9 /openbsc/src/bsc_api.c
parent088dde817306bd394a8a3724b3bdf5332be45c72 (diff)
bsc_api: Set the lchan->conn to NULL in all of the cases
Diffstat (limited to 'openbsc/src/bsc_api.c')
-rw-r--r--openbsc/src/bsc_api.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/openbsc/src/bsc_api.c b/openbsc/src/bsc_api.c
index 7a30e1649..9ab49f4e0 100644
--- a/openbsc/src/bsc_api.c
+++ b/openbsc/src/bsc_api.c
@@ -142,9 +142,6 @@ struct gsm_subscriber_connection *subscr_con_allocate(struct gsm_lchan *lchan)
/* TODO: move subscriber put here... */
void subscr_con_free(struct gsm_subscriber_connection *conn)
{
- struct gsm_lchan *lchan;
-
-
if (!conn)
return;
@@ -155,16 +152,18 @@ void subscr_con_free(struct gsm_subscriber_connection *conn)
}
- if (conn->ho_lchan)
+ if (conn->ho_lchan) {
LOGP(DNM, LOGL_ERROR, "The ho_lchan should have been cleared.\n");
+ conn->ho_lchan->conn = NULL;
+ }
- llist_del(&conn->entry);
+ if (conn->lchan) {
+ LOGP(DNM, LOGL_ERROR, "The lchan should have been cleared.\n");
+ conn->lchan->conn = NULL;
+ }
- lchan = conn->lchan;
+ llist_del(&conn->entry);
talloc_free(conn);
-
- if (lchan)
- lchan->conn = NULL;
}
int bsc_api_init(struct gsm_network *network, struct bsc_api *api)