Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Apr 2017 03:23:03 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r316808 - head/sys/dev/txp
Message-ID:  <201704140323.v3E3N3M0093704@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yongari
Date: Fri Apr 14 03:23:03 2017
New Revision: 316808
URL: https://svnweb.freebsd.org/changeset/base/316808

Log:
  Remove unnecessary check aginst NULL.  txp_ext_command() with
  TXP_CMD_WAIT argument allocates a response buffer.  If the allocation
  fails, txp_ext_command() returns an error and it's handed in caller.
  
  Found by:	PVS-Studio

Modified:
  head/sys/dev/txp/if_txp.c

Modified: head/sys/dev/txp/if_txp.c
==============================================================================
--- head/sys/dev/txp/if_txp.c	Fri Apr 14 03:20:34 2017	(r316807)
+++ head/sys/dev/txp/if_txp.c	Fri Apr 14 03:23:03 2017	(r316808)
@@ -400,8 +400,7 @@ txp_attach(device_t dev)
 		    "Unknown Typhoon sleep image version: %u:0x%08x\n",
 		    rsp->rsp_numdesc, p2);
 	}
-	if (rsp != NULL)
-		free(rsp, M_DEVBUF);
+	free(rsp, M_DEVBUF);
 
 	sc->sc_xcvr = TXP_XCVR_AUTO;
 	txp_command(sc, TXP_CMD_XCVR_SELECT, TXP_XCVR_AUTO, 0, 0,



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