aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/outqueue.c
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2016-09-13 14:04:20 -0400
committerDavid S. Miller <davem@davemloft.net>2016-09-18 22:02:32 -0400
commitb61c654f9b3f1a271217e46c893f80565b1f754d (patch)
tree90a668733bd29a38dbbb939a5a241942b69501f3 /net/sctp/outqueue.c
parent66388f2c08dfa38071f9eceae7bb29060d9be9aa (diff)
sctp: free msg->chunks when sctp_primitive_SEND return err
Last patch "sctp: do not return the transmit err back to sctp_sendmsg" made sctp_primitive_SEND return err only when asoc state is unavailable. In this case, chunks are not enqueued, they have no chance to be freed if we don't take care of them later. This Patch is actually to revert commit 1cd4d5c4326a ("sctp: remove the unused sctp_datamsg_free()"), commit 69b5777f2e57 ("sctp: hold the chunks only after the chunk is enqueued in outq") and commit 8b570dc9f7b6 ("sctp: only drop the reference on the datamsg after sending a msg"), to use sctp_datamsg_free to free the chunks of current msg. Fixes: 8b570dc9f7b6 ("sctp: only drop the reference on the datamsg after sending a msg") Signed-off-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/outqueue.c')
-rw-r--r--net/sctp/outqueue.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index da2418b64c86..6c109b0f8495 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -304,7 +304,6 @@ int sctp_outq_tail(struct sctp_outq *q, struct sctp_chunk *chunk, gfp_t gfp)
304 sctp_cname(SCTP_ST_CHUNK(chunk->chunk_hdr->type)) : 304 sctp_cname(SCTP_ST_CHUNK(chunk->chunk_hdr->type)) :
305 "illegal chunk"); 305 "illegal chunk");
306 306
307 sctp_chunk_hold(chunk);
308 sctp_outq_tail_data(q, chunk); 307 sctp_outq_tail_data(q, chunk);
309 if (chunk->asoc->prsctp_enable && 308 if (chunk->asoc->prsctp_enable &&
310 SCTP_PR_PRIO_ENABLED(chunk->sinfo.sinfo_flags)) 309 SCTP_PR_PRIO_ENABLED(chunk->sinfo.sinfo_flags))