aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/rsl.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2012-04-16 21:46:19 +0200
committerHarald Welte <laforge@gnumonks.org>2012-04-19 09:39:52 +0200
commitaf02387183acd5cd80d3183862c8a6a2ed8318d1 (patch)
tree57cac41261736527670ee1216a8bd3bc5451b77a /src/common/rsl.c
parentf78f35880f65fc1aa9dc508465260cdd9d815514 (diff)
lchan: rsl_tx_chan_nack will re-use the msgb, do not msgb_free
Do not msgb_free the msg as it will be re-used inside the nack method and return 1 so the caller does not free the msgb. This ownership model needs some consideration but the usage of ref counts will not yield good results.
Diffstat (limited to 'src/common/rsl.c')
-rw-r--r--src/common/rsl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 49a38e5b..e426aa53 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -621,16 +621,16 @@ static int rsl_rx_chan_activ(struct msgb *msg)
/* 9.3.3 Activation Type */
if (!TLVP_PRESENT(&tp, RSL_IE_ACT_TYPE)) {
LOGP(DRSL, LOGL_NOTICE, "missing Activation Type\n");
- msgb_free(msg);
- return rsl_tx_chan_nack(msg->trx, msg, RSL_ERR_MAND_IE_ERROR);
+ rsl_tx_chan_nack(msg->trx, msg, RSL_ERR_MAND_IE_ERROR);
+ return 1;
}
type = *TLVP_VAL(&tp, RSL_IE_ACT_TYPE);
/* 9.3.6 Channel Mode */
if (!TLVP_PRESENT(&tp, RSL_IE_CHAN_MODE)) {
LOGP(DRSL, LOGL_NOTICE, "missing Channel Mode\n");
- msgb_free(msg);
- return rsl_tx_chan_nack(msg->trx, msg, RSL_ERR_MAND_IE_ERROR);
+ rsl_tx_chan_nack(msg->trx, msg, RSL_ERR_MAND_IE_ERROR);
+ return 1;
}
cm = (struct rsl_ie_chan_mode *) TLVP_VAL(&tp, RSL_IE_CHAN_MODE);
lchan_tchmode_from_cmode(lchan, cm);