svn commit: r316808 - head/sys/dev/txp

Pyun YongHyeon yongari at FreeBSD.org
Fri Apr 14 03:23:05 UTC 2017


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,


More information about the svn-src-all mailing list