sctp: remove a redundant NULL check
Subsystems (4)
PATCH 1/1 sctp: remove a redundant NULL check
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 <[email protected]>
net/sctp/socket.c +1 -1
@@ -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) {
Quoted 10 lines · Dan Carpenter
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 <[email protected]>net/sctp/socket.c +0
-0
net/sctp/socket.c static int sctp_sendmsg(struct kiocb *iocb, struct sock *sk, · line 1748
Quoted 7 lines
net/sctp/socket.c +1
-1@@ -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) {
Acked-by Neil Horman <[email protected]>
Quoted 5 lines
net/sctp/socket.c +0
-1--To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Dan Carpenter <[email protected]>
Date: Mon, 13 Jan 2014 16:46:08 +0300
Quoted 4 lines
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 <[email protected]>
Applied.