Skip to contentSkip to conversation

sctp: remove a redundant NULL check

PATCH Applied Dan Carpenter 3 participants 3 messages Jan 13, 2014 – Jan 15, 2014

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

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.

net/sctp/socket.c +1 -1
index d32dae78a486..27f1717170c2 100644
@@ -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 on v1 1/1
#1 lore raw
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.

net/sctp/socket.c +0 -0
index d32dae78a486..27f1717170c2 100644

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) {
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