Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 336076
b: refs/heads/master
c: 6e51fe7
h: refs/heads/master
v: v3
  • Loading branch information
Tommi Rantala authored and David S. Miller committed Nov 28, 2012
1 parent dc3e8bc commit 729da88
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: be364c8c0f17a3dd42707b5a090b318028538eb9
refs/heads/master: 6e51fe7572590d8d86e93b547fab6693d305fd0d
13 changes: 9 additions & 4 deletions trunk/net/sctp/chunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,

msg = sctp_datamsg_new(GFP_KERNEL);
if (!msg)
return NULL;
return ERR_PTR(-ENOMEM);

/* Note: Calculate this outside of the loop, so that all fragments
* have the same expiration.
Expand Down Expand Up @@ -280,8 +280,11 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,

chunk = sctp_make_datafrag_empty(asoc, sinfo, len, frag, 0);

if (!chunk)
if (!chunk) {
err = -ENOMEM;
goto errout;
}

err = sctp_user_addto_chunk(chunk, offset, len, msgh->msg_iov);
if (err < 0)
goto errout_chunk_free;
Expand Down Expand Up @@ -315,8 +318,10 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,

chunk = sctp_make_datafrag_empty(asoc, sinfo, over, frag, 0);

if (!chunk)
if (!chunk) {
err = -ENOMEM;
goto errout;
}

err = sctp_user_addto_chunk(chunk, offset, over,msgh->msg_iov);

Expand All @@ -342,7 +347,7 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,
sctp_chunk_free(chunk);
}
sctp_datamsg_put(msg);
return NULL;
return ERR_PTR(err);
}

/* Check whether this message has expired. */
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/sctp/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -1915,8 +1915,8 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,

/* Break the message into multiple chunks of maximum size. */
datamsg = sctp_datamsg_from_user(asoc, sinfo, msg, msg_len);
if (!datamsg) {
err = -ENOMEM;
if (IS_ERR(datamsg)) {
err = PTR_ERR(datamsg);
goto out_free;
}

Expand Down

0 comments on commit 729da88

Please sign in to comment.