diff options
author | yongari <yongari@FreeBSD.org> | 2011-11-07 22:53:06 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2011-11-07 22:53:06 +0000 |
commit | 711c65d39de6d201e781d53acafb50526f6640af (patch) | |
tree | 470842dbb4bbcaeade623bf59957aca9363a9427 /sys/dev/ti | |
parent | 990f68fb09d7d342937ca6db09af0013d3cb4413 (diff) | |
download | FreeBSD-src-711c65d39de6d201e781d53acafb50526f6640af.zip FreeBSD-src-711c65d39de6d201e781d53acafb50526f6640af.tar.gz |
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.
Diffstat (limited to 'sys/dev/ti')
-rw-r--r-- | sys/dev/ti/if_ti.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/ti/if_ti.c b/sys/dev/ti/if_ti.c index 5734d46..fefa0e7 100644 --- a/sys/dev/ti/if_ti.c +++ b/sys/dev/ti/if_ti.c @@ -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); |