aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r--net/sctp/socket.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 33d9ee629b4e..6766913a53e6 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -1496,7 +1496,7 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
1496 struct sctp_chunk *chunk; 1496 struct sctp_chunk *chunk;
1497 union sctp_addr to; 1497 union sctp_addr to;
1498 struct sockaddr *msg_name = NULL; 1498 struct sockaddr *msg_name = NULL;
1499 struct sctp_sndrcvinfo default_sinfo = { 0 }; 1499 struct sctp_sndrcvinfo default_sinfo;
1500 struct sctp_sndrcvinfo *sinfo; 1500 struct sctp_sndrcvinfo *sinfo;
1501 struct sctp_initmsg *sinit; 1501 struct sctp_initmsg *sinit;
1502 sctp_assoc_t associd = 0; 1502 sctp_assoc_t associd = 0;
@@ -1760,6 +1760,7 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
1760 /* If the user didn't specify SNDRCVINFO, make up one with 1760 /* If the user didn't specify SNDRCVINFO, make up one with
1761 * some defaults. 1761 * some defaults.
1762 */ 1762 */
1763 memset(&default_sinfo, 0, sizeof(default_sinfo));
1763 default_sinfo.sinfo_stream = asoc->default_stream; 1764 default_sinfo.sinfo_stream = asoc->default_stream;
1764 default_sinfo.sinfo_flags = asoc->default_flags; 1765 default_sinfo.sinfo_flags = asoc->default_flags;
1765 default_sinfo.sinfo_ppid = asoc->default_ppid; 1766 default_sinfo.sinfo_ppid = asoc->default_ppid;
@@ -1790,12 +1791,10 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
1790 goto out_free; 1791 goto out_free;
1791 } 1792 }
1792 1793
1793 if (sinfo) { 1794 /* Check for invalid stream. */
1794 /* Check for invalid stream. */ 1795 if (sinfo->sinfo_stream >= asoc->c.sinit_num_ostreams) {
1795 if (sinfo->sinfo_stream >= asoc->c.sinit_num_ostreams) { 1796 err = -EINVAL;
1796 err = -EINVAL; 1797 goto out_free;
1797 goto out_free;
1798 }
1799 } 1798 }
1800 1799
1801 timeo = sock_sndtimeo(sk, msg->msg_flags & MSG_DONTWAIT); 1800 timeo = sock_sndtimeo(sk, msg->msg_flags & MSG_DONTWAIT);