netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] sctp: cleanup: remove unneeded null check
@ 2010-04-23 11:59 Dan Carpenter
  2010-04-23 14:28 ` Vlad Yasevich
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2010-04-23 11:59 UTC (permalink / raw)
  To: Vlad Yasevich
  Cc: Sridhar Samudrala, David S. Miller, Wei Yongjun, Chris Dischino,
	linux-sctp, netdev, kernel-janitors

"chunk" can never be null here.  We dereferenced it earlier in the
function and also at the start of the function we passed it to 
sctp_pack_cookie() which dereferences it.

This code has been around since the dawn of git history so if "chunk"
were ever null someone would have complained about it.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 17cb400..52352fc 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -470,8 +470,7 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc,
 	 *
 	 * [INIT ACK back to where the INIT came from.]
 	 */
-	if (chunk)
-		retval->transport = chunk->transport;
+	retval->transport = chunk->transport;
 
 nomem_chunk:
 	kfree(cookie);

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-04-27 17:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-23 11:59 [patch] sctp: cleanup: remove unneeded null check Dan Carpenter
2010-04-23 14:28 ` Vlad Yasevich
2010-04-24 17:19   ` [patch v2] sctp: cleanup: remove duplicate assignment Dan Carpenter
2010-04-27 14:32     ` Vlad Yasevich
2010-04-27 16:58       ` David Miller
2010-04-27 17:32         ` Vlad Yasevich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).