From owner-svn-src-all@FreeBSD.ORG Mon Nov 7 22:53:06 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D51C6106566B; Mon, 7 Nov 2011 22:53:06 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C58A68FC20; Mon, 7 Nov 2011 22:53:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA7Mr6F4000212; Mon, 7 Nov 2011 22:53:06 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA7Mr6L4000210; Mon, 7 Nov 2011 22:53:06 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111072253.pA7Mr6L4000210@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 7 Nov 2011 22:53:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227323 - head/sys/dev/ti X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 22:53:06 -0000 Author: yongari Date: Mon Nov 7 22:53:06 2011 New Revision: 227323 URL: http://svn.freebsd.org/changeset/base/227323 Log: If ti_chipinit() fails in ti_stop(), ignore the error and release all allocated TX/RX buffer resources. If the interface is brought to up again after the error, we will leak allocated TX/RX buffers. Modified: head/sys/dev/ti/if_ti.c Modified: head/sys/dev/ti/if_ti.c ============================================================================== --- head/sys/dev/ti/if_ti.c Mon Nov 7 22:47:25 2011 (r227322) +++ head/sys/dev/ti/if_ti.c Mon Nov 7 22:53:06 2011 (r227323) @@ -3845,11 +3845,11 @@ ti_stop(struct ti_softc *sc) TI_DO_CMD(TI_CMD_HOST_STATE, TI_CMD_CODE_STACK_DOWN, 0); /* Halt and reinitialize. */ - if (ti_chipinit(sc) != 0) - return; - ti_mem_zero(sc, 0x2000, 0x100000 - 0x2000); - if (ti_chipinit(sc) != 0) - return; + if (ti_chipinit(sc) == 0) { + ti_mem_zero(sc, 0x2000, 0x100000 - 0x2000); + /* XXX ignore init errors. */ + ti_chipinit(sc); + } /* Free the RX lists. */ ti_free_rx_ring_std(sc);