Skip to contentSkip to conversation

sctp: remove unnecessary NULL test in sendmsg()

PATCH New Wei Yongjun 1 participant 1 message Apr 19, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sctp: remove unnecessary NULL test in sendmsg()

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

---
 net/sctp/socket.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
net/sctp/socket.c +4 -6
index 783d865..5de892f 100644
@@ -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);
Signature · 1 line
1.6.5.2