aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/sctp/socket.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index d4b8db177e27..6766913a53e6 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -1791,12 +1791,10 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
1791 goto out_free; 1791 goto out_free;
1792 } 1792 }
1793 1793
1794 if (sinfo) { 1794 /* Check for invalid stream. */
1795 /* Check for invalid stream. */ 1795 if (sinfo->sinfo_stream >= asoc->c.sinit_num_ostreams) {
1796 if (sinfo->sinfo_stream >= asoc->c.sinit_num_ostreams) { 1796 err = -EINVAL;
1797 err = -EINVAL; 1797 goto out_free;
1798 goto out_free;
1799 }
1800 } 1798 }
1801 1799
1802 timeo = sock_sndtimeo(sk, msg->msg_flags & MSG_DONTWAIT); 1800 timeo = sock_sndtimeo(sk, msg->msg_flags & MSG_DONTWAIT);