mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-11-02 04:53:24 +00:00
bsc_api: Clear lchan->conn on lchan_release
Set conn to NULL before starting the release procedure, remove code to check for a lchan->conn as it can not happen. If there are any memleaks we will notice them. Detach the lchan->conn from the channel before detaching.
This commit is contained in:
@@ -368,10 +368,8 @@ int gsm0808_clear(struct gsm_subscriber_connection *conn)
|
|||||||
if (conn->ho_lchan)
|
if (conn->ho_lchan)
|
||||||
bsc_clear_handover(conn);
|
bsc_clear_handover(conn);
|
||||||
|
|
||||||
if (conn->lchan) {
|
if (conn->lchan)
|
||||||
lchan_release(conn->lchan, 1, 0);
|
lchan_release(conn->lchan, 1, 0);
|
||||||
conn->lchan->conn = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
conn->lchan = NULL;
|
conn->lchan = NULL;
|
||||||
conn->ho_lchan = NULL;
|
conn->ho_lchan = NULL;
|
||||||
|
|||||||
@@ -281,13 +281,6 @@ struct gsm_lchan *lchan_alloc(struct gsm_bts *bts, enum gsm_chan_t type,
|
|||||||
|
|
||||||
/* clear multi rate config */
|
/* clear multi rate config */
|
||||||
memset(&lchan->mr_conf, 0, sizeof(lchan->mr_conf));
|
memset(&lchan->mr_conf, 0, sizeof(lchan->mr_conf));
|
||||||
|
|
||||||
/* clear per MSC/BSC data */
|
|
||||||
if (lchan->conn) {
|
|
||||||
LOGP(DRLL, LOGL_ERROR, "lchan->conn should be NULL.\n");
|
|
||||||
subscr_con_free(lchan->conn);
|
|
||||||
lchan->conn = NULL;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
struct challoc_signal_data sig;
|
struct challoc_signal_data sig;
|
||||||
sig.bts = bts;
|
sig.bts = bts;
|
||||||
@@ -338,7 +331,6 @@ void lchan_free(struct gsm_lchan *lchan)
|
|||||||
|
|
||||||
if (lchan->conn) {
|
if (lchan->conn) {
|
||||||
LOGP(DRLL, LOGL_ERROR, "the subscriber connection should be gone.\n");
|
LOGP(DRLL, LOGL_ERROR, "the subscriber connection should be gone.\n");
|
||||||
subscr_con_free(lchan->conn);
|
|
||||||
lchan->conn = NULL;
|
lchan->conn = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -422,6 +414,7 @@ int lchan_release(struct gsm_lchan *lchan, int sach_deact, int reason)
|
|||||||
DEBUGP(DRLL, "%s starting release sequence\n", gsm_lchan_name(lchan));
|
DEBUGP(DRLL, "%s starting release sequence\n", gsm_lchan_name(lchan));
|
||||||
rsl_lchan_set_state(lchan, LCHAN_S_REL_REQ);
|
rsl_lchan_set_state(lchan, LCHAN_S_REL_REQ);
|
||||||
|
|
||||||
|
lchan->conn = NULL;
|
||||||
lchan->release_reason = reason;
|
lchan->release_reason = reason;
|
||||||
lchan->sach_deact = sach_deact;
|
lchan->sach_deact = sach_deact;
|
||||||
_lchan_handle_release(lchan);
|
_lchan_handle_release(lchan);
|
||||||
|
|||||||
Reference in New Issue
Block a user