From 90b45a3200979cfbcf03b9d4493ffbdfd049737c Mon Sep 17 00:00:00 2001 From: Pyun YongHyeon Date: Fri, 14 Apr 2017 02:33:26 +0000 Subject: [PATCH] Remove unnecessary comparison. Found by: PVS-Studio --- sys/dev/fxp/if_fxp.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c index 543eba9c91f..cf23694c7bf 100644 --- a/sys/dev/fxp/if_fxp.c +++ b/sys/dev/fxp/if_fxp.c @@ -2212,18 +2212,15 @@ fxp_stop(struct fxp_softc *sc) * Release any xmit buffers. */ txp = sc->fxp_desc.tx_list; - if (txp != NULL) { - for (i = 0; i < FXP_NTXCB; i++) { - if (txp[i].tx_mbuf != NULL) { - bus_dmamap_sync(sc->fxp_txmtag, txp[i].tx_map, - BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(sc->fxp_txmtag, - txp[i].tx_map); - m_freem(txp[i].tx_mbuf); - txp[i].tx_mbuf = NULL; - /* clear this to reset csum offload bits */ - txp[i].tx_cb->tbd[0].tb_addr = 0; - } + for (i = 0; i < FXP_NTXCB; i++) { + if (txp[i].tx_mbuf != NULL) { + bus_dmamap_sync(sc->fxp_txmtag, txp[i].tx_map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->fxp_txmtag, txp[i].tx_map); + m_freem(txp[i].tx_mbuf); + txp[i].tx_mbuf = NULL; + /* clear this to reset csum offload bits */ + txp[i].tx_cb->tbd[0].tb_addr = 0; } } bus_dmamap_sync(sc->cbl_tag, sc->cbl_map,