All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sctp: remove unnecessary NULL test in sendmsg()
@ 2010-04-19  8:31 Wei Yongjun
  0 siblings, 0 replies; only message in thread
From: Wei Yongjun @ 2010-04-19  8:31 UTC (permalink / raw)
  To: linux-sctp

sinfo shuould either be set by the user or set to the default_sifo,
so it can never be NULL.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 net/sctp/socket.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 783d865..5de892f 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,
 		goto out_free;
 	}
 
-	if (sinfo) {
-		/* Check for invalid stream. */
-		if (sinfo->sinfo_stream >= asoc->c.sinit_num_ostreams) {
-			err = -EINVAL;
-			goto out_free;
-		}
+	/* Check for invalid stream. */
+	if (sinfo->sinfo_stream >= asoc->c.sinit_num_ostreams) {
+		err = -EINVAL;
+		goto out_free;
 	}
 
 	timeo = sock_sndtimeo(sk, msg->msg_flags & MSG_DONTWAIT);
-- 
1.6.5.2



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-04-19  8:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-19  8:31 [PATCH] sctp: remove unnecessary NULL test in sendmsg() Wei Yongjun

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.