summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-12-29 23:33:04 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2012-01-15 00:28:15 +0100
commitc0a6674614fb362c80d2a83bd3e543ccd4bf0c49 (patch)
tree54b1e98ea19b18bf349f063efc3affe81eef0c39
parentdfcfe65f249efdd79df57e8516c226755ffc1748 (diff)
channel: Review lchan_free calls and the state the channel is in
In case of a memory allocation failure in rsl_rx_chan_rqd we would have left the channel in the LCHAN_S_ACT_REQ state. Move the state change below the allocation.
-rw-r--r--openbsc/src/libbsc/abis_rsl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c
index 63b8729b7..c508e39e2 100644
--- a/openbsc/src/libbsc/abis_rsl.c
+++ b/openbsc/src/libbsc/abis_rsl.c
@@ -1284,7 +1284,6 @@ static int rsl_rx_chan_rqd(struct msgb *msg)
LOGP(DRSL, LOGL_NOTICE, "%s lchan_alloc() returned channel "
"in state %s\n", gsm_lchan_name(lchan),
gsm_lchans_name(lchan->state));
- rsl_lchan_set_state(lchan, LCHAN_S_ACT_REQ);
/* save the RACH data as we need it after the CHAN ACT ACK */
lchan->rqd_ref = talloc_zero(bts, struct gsm48_req_ref);
@@ -1294,6 +1293,7 @@ static int rsl_rx_chan_rqd(struct msgb *msg)
return -ENOMEM;
}
+ rsl_lchan_set_state(lchan, LCHAN_S_ACT_REQ);
memcpy(lchan->rqd_ref, rqd_ref, sizeof(*rqd_ref));
lchan->rqd_ta = rqd_ta;