Fix a bug that could cause dc(4) to m_freem() an already freed

mbuf or something that isn't an mbuf.

MFC after:	3 days
This commit is contained in:
mux 2003-07-06 14:39:45 +00:00
parent 6ac446e15c
commit 79e81b3cc3
2 changed files with 4 additions and 2 deletions

View File

@ -3539,7 +3539,8 @@ dc_stop(struct dc_softc *sc)
*/
for (i = 0; i < DC_TX_LIST_CNT; i++) {
if (cd->dc_tx_chain[i] != NULL) {
if (ld->dc_tx_list[i].dc_ctl & DC_TXCTL_SETUP) {
if ((ld->dc_tx_list[i].dc_ctl & DC_TXCTL_SETUP) ||
!(ld->dc_tx_list[i].dc_ctl & DC_TXCTL_LASTFRAG)) {
cd->dc_tx_chain[i] = NULL;
continue;
}

View File

@ -3539,7 +3539,8 @@ dc_stop(struct dc_softc *sc)
*/
for (i = 0; i < DC_TX_LIST_CNT; i++) {
if (cd->dc_tx_chain[i] != NULL) {
if (ld->dc_tx_list[i].dc_ctl & DC_TXCTL_SETUP) {
if ((ld->dc_tx_list[i].dc_ctl & DC_TXCTL_SETUP) ||
!(ld->dc_tx_list[i].dc_ctl & DC_TXCTL_LASTFRAG)) {
cd->dc_tx_chain[i] = NULL;
continue;
}