Avoid dereferencing random memory when kickstarting DMA.

MFC after: 1 week
This commit is contained in:
Nathan Whitehorn 2018-02-24 22:34:56 +00:00
parent 0d41f9c9f0
commit f638d50513
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=329941

View File

@ -832,7 +832,8 @@ glc_txintr(struct glc_softc *sc)
/* Speculatively (or necessarily) start the TX queue again */
error = lv1_net_start_tx_dma(sc->sc_bus, sc->sc_dev,
sc->sc_txdmadesc_phys +
txs->txs_firstdesc*sizeof(struct glc_dmadesc), 0);
((txs == NULL) ? 0 : txs->txs_firstdesc)*
sizeof(struct glc_dmadesc), 0);
if (error != 0)
device_printf(sc->sc_self,
"lv1_net_start_tx_dma error: %d\n", error);