|
@@ -284,7 +284,7 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,
|
|
|
goto errout;
|
|
|
err = sctp_user_addto_chunk(chunk, offset, len, msgh->msg_iov);
|
|
|
if (err < 0)
|
|
|
- goto errout;
|
|
|
+ goto errout_chunk_free;
|
|
|
|
|
|
offset += len;
|
|
|
|
|
@@ -324,7 +324,7 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,
|
|
|
__skb_pull(chunk->skb, (__u8 *)chunk->chunk_hdr
|
|
|
- (__u8 *)chunk->skb->data);
|
|
|
if (err < 0)
|
|
|
- goto errout;
|
|
|
+ goto errout_chunk_free;
|
|
|
|
|
|
sctp_datamsg_assign(msg, chunk);
|
|
|
list_add_tail(&chunk->frag_list, &msg->chunks);
|
|
@@ -332,6 +332,9 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,
|
|
|
|
|
|
return msg;
|
|
|
|
|
|
+errout_chunk_free:
|
|
|
+ sctp_chunk_free(chunk);
|
|
|
+
|
|
|
errout:
|
|
|
list_for_each_safe(pos, temp, &msg->chunks) {
|
|
|
list_del_init(pos);
|