Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Dec 2014 13:58:54 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r276009 - head/sys/netinet
Message-ID:  <201412211358.sBLDwskr040816@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Sun Dec 21 13:58:53 2014
New Revision: 276009
URL: https://svnweb.freebsd.org/changeset/base/276009

Log:
  Don't check twice that inp is not NULL.
  
  Reported by:	Coverity
  CID:		748671
  MFC after:	3 days

Modified:
  head/sys/netinet/sctputil.c

Modified: head/sys/netinet/sctputil.c
==============================================================================
--- head/sys/netinet/sctputil.c	Sun Dec 21 13:32:07 2014	(r276008)
+++ head/sys/netinet/sctputil.c	Sun Dec 21 13:58:53 2014	(r276009)
@@ -1949,7 +1949,7 @@ sctp_timer_start(int t_type, struct sctp
 		 * though we use a different timer. We also add the HB timer
 		 * PLUS a random jitter.
 		 */
-		if ((inp == NULL) || (stcb == NULL) || (net == NULL)) {
+		if ((stcb == NULL) || (net == NULL)) {
 			return;
 		} else {
 			uint32_t rndval;
@@ -2004,9 +2004,6 @@ sctp_timer_start(int t_type, struct sctp
 		 * nothing needed but the endpoint here ususually about 60
 		 * minutes.
 		 */
-		if (inp == NULL) {
-			return;
-		}
 		tmr = &inp->sctp_ep.signature_change;
 		to_ticks = inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_SIGNATURE];
 		break;
@@ -2023,9 +2020,6 @@ sctp_timer_start(int t_type, struct sctp
 		 * timer since that has stopped and we are in the GONE
 		 * state.
 		 */
-		if (inp == NULL) {
-			return;
-		}
 		tmr = &inp->sctp_ep.signature_change;
 		to_ticks = MSEC_TO_TICKS(SCTP_INP_KILL_TIMEOUT);
 		break;
@@ -2034,10 +2028,7 @@ sctp_timer_start(int t_type, struct sctp
 		 * Here we use the value found in the EP for PMTU ususually
 		 * about 10 minutes.
 		 */
-		if ((stcb == NULL) || (inp == NULL)) {
-			return;
-		}
-		if (net == NULL) {
+		if ((stcb == NULL) || (net == NULL)) {
 			return;
 		}
 		if (net->dest_state & SCTP_ADDR_NO_PMTUD) {
@@ -2063,7 +2054,7 @@ sctp_timer_start(int t_type, struct sctp
 		 * Here we use the endpoints shutdown guard timer usually
 		 * about 3 minutes.
 		 */
-		if ((inp == NULL) || (stcb == NULL)) {
+		if (stcb == NULL) {
 			return;
 		}
 		to_ticks = inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_MAXSHUTDOWN];



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412211358.sBLDwskr040816>