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.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c
index 7c2df9c33df3..f2aebdbb1eda 100644
--- a/net/sctp/chunk.c
+++ b/net/sctp/chunk.c
@@ -284,7 +284,7 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,
284 goto errout; 284 goto errout;
285 err = sctp_user_addto_chunk(chunk, offset, len, msgh->msg_iov); 285 err = sctp_user_addto_chunk(chunk, offset, len, msgh->msg_iov);
286 if (err < 0) 286 if (err < 0)
287 goto errout; 287 goto errout_chunk_free;
288 288
289 offset += len; 289 offset += len;
290 290
@@ -324,7 +324,7 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,
324 __skb_pull(chunk->skb, (__u8 *)chunk->chunk_hdr 324 __skb_pull(chunk->skb, (__u8 *)chunk->chunk_hdr
325 - (__u8 *)chunk->skb->data); 325 - (__u8 *)chunk->skb->data);
326 if (err < 0) 326 if (err < 0)
327 goto errout; 327 goto errout_chunk_free;
328 328
329 sctp_datamsg_assign(msg, chunk); 329 sctp_datamsg_assign(msg, chunk);
330 list_add_tail(&chunk->frag_list, &msg->chunks); 330 list_add_tail(&chunk->frag_list, &msg->chunks);
@@ -332,6 +332,9 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,
332 332
333 return msg; 333 return msg;
334 334
335errout_chunk_free:
336 sctp_chunk_free(chunk);
337
335errout: 338errout:
336 list_for_each_safe(pos, temp, &msg->chunks) { 339 list_for_each_safe(pos, temp, &msg->chunks) {
337 list_del_init(pos); 340 list_del_init(pos);