Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Jul 2016 07:07:16 +0000 (UTC)
From:      Garrett Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r302551 - head/sys/rpc
Message-ID:  <201607110707.u6B77GCs059273@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Mon Jul 11 07:07:15 2016
New Revision: 302551
URL: https://svnweb.freebsd.org/changeset/base/302551

Log:
  Deobfuscate cleanup path in clnt_vc_create(..)
  
  Similar to r300836, r301800, and r302550, cl and ct will always
  be non-NULL as they're allocated using the mem_alloc routines,
  which always use `malloc(..., M_WAITOK)`.
  
  MFC after: 1 week
  Reported by: Coverity
  CID: 1007342
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/rpc/clnt_vc.c

Modified: head/sys/rpc/clnt_vc.c
==============================================================================
--- head/sys/rpc/clnt_vc.c	Mon Jul 11 06:58:24 2016	(r302550)
+++ head/sys/rpc/clnt_vc.c	Mon Jul 11 07:07:15 2016	(r302551)
@@ -270,12 +270,10 @@ clnt_vc_create(
 	return (cl);
 
 err:
-	if (ct) {
-		mtx_destroy(&ct->ct_lock);
-		mem_free(ct, sizeof (struct ct_data));
-	}
-	if (cl)
-		mem_free(cl, sizeof (CLIENT));
+	mtx_destroy(&ct->ct_lock);
+	mem_free(ct, sizeof (struct ct_data));
+	mem_free(cl, sizeof (CLIENT));
+
 	return ((CLIENT *)NULL);
 }
 



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