aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/osmo-bsc/abis_rsl.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index ac8006d33..7525e310c 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -939,11 +939,7 @@ int rsl_siemens_mrpci(struct gsm_lchan *lchan, struct rsl_mrpci *mrpci)
/* Chapter 8.3.1 */
int rsl_data_request(struct msgb *msg, uint8_t link_id)
{
- int chan_nr = gsm_lchan2chan_nr(msg->lchan, true);
- if (chan_nr < 0) {
- msgb_free(msg);
- return chan_nr;
- }
+ int chan_nr;
if (msg->lchan == NULL) {
LOGP(DRSL, LOGL_ERROR, "cannot send DATA REQUEST to unknown lchan\n");
@@ -951,6 +947,12 @@ int rsl_data_request(struct msgb *msg, uint8_t link_id)
return -EINVAL;
}
+ chan_nr = gsm_lchan2chan_nr(msg->lchan, true);
+ if (chan_nr < 0) {
+ msgb_free(msg);
+ return chan_nr;
+ }
+
rsl_rll_push_l3(msg, RSL_MT_DATA_REQ, chan_nr, link_id, 1);
msg->dst = rsl_chan_link(msg->lchan);