sctp: remove a redundant NULL check
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 13 Jan 2014 13:46:08 +0000 (16:46 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Jan 2014 02:18:22 +0000 (18:18 -0800)
It confuses Smatch when we check "sinit" for NULL and then non-NULL and
that causes a false positive warning later.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/socket.c

index 7cc62b9..6b20a15 100644 (file)
@@ -1743,7 +1743,7 @@ static int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
                 * either the default or the user specified stream counts.
                 */
                if (sinfo) {
-                       if (!sinit || (sinit && !sinit->sinit_num_ostreams)) {
+                       if (!sinit || !sinit->sinit_num_ostreams) {
                                /* Check against the defaults. */
                                if (sinfo->sinfo_stream >=
                                    sp->initmsg.sinit_num_ostreams) {