Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Nov 2011 22:53:06 +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: r227323 - head/sys/dev/ti
Message-ID:  <201111072253.pA7Mr6L4000210@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



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