From owner-svn-src-head@freebsd.org Fri Apr 14 03:23:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB857D3D618; Fri, 14 Apr 2017 03:23:04 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBCABBA7; Fri, 14 Apr 2017 03:23:04 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3E3N3Tc093705; Fri, 14 Apr 2017 03:23:03 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3E3N3M0093704; Fri, 14 Apr 2017 03:23:03 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201704140323.v3E3N3M0093704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Fri, 14 Apr 2017 03:23:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316808 - head/sys/dev/txp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 03:23:05 -0000 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,