aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/chunk.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp/chunk.c')
-rw-r--r--net/sctp/chunk.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c
index 7acaf15679b6..645577ddc33e 100644
--- a/net/sctp/chunk.c
+++ b/net/sctp/chunk.c
@@ -73,6 +73,19 @@ SCTP_STATIC struct sctp_datamsg *sctp_datamsg_new(gfp_t gfp)
73 return msg; 73 return msg;
74} 74}
75 75
76void sctp_datamsg_free(struct sctp_datamsg *msg)
77{
78 struct sctp_chunk *chunk;
79
80 /* This doesn't have to be a _safe vairant because
81 * sctp_chunk_free() only drops the refs.
82 */
83 list_for_each_entry(chunk, &msg->chunks, frag_list)
84 sctp_chunk_free(chunk);
85
86 sctp_datamsg_put(msg);
87}
88
76/* Final destructruction of datamsg memory. */ 89/* Final destructruction of datamsg memory. */
77static void sctp_datamsg_destroy(struct sctp_datamsg *msg) 90static void sctp_datamsg_destroy(struct sctp_datamsg *msg)
78{ 91{