summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_xl.c
diff options
context:
space:
mode:
authorroam <roam@FreeBSD.org>2004-08-06 09:08:33 +0000
committerroam <roam@FreeBSD.org>2004-08-06 09:08:33 +0000
commite8cd4126007b2c8b25d70b20bb84145d16bc3ebb (patch)
tree0e296af4379c4c2fbc36730b13a73dc6d5f874bc /sys/pci/if_xl.c
parente98b8f144564872ad28855de0670eeeb495de9f7 (diff)
downloadFreeBSD-src-e8cd4126007b2c8b25d70b20bb84145d16bc3ebb.zip
FreeBSD-src-e8cd4126007b2c8b25d70b20bb84145d16bc3ebb.tar.gz
Do not attempt to clean up data that has not been initialized yet.
This fixes two kernel panics on boot when the xl driver fails to allocate bus/port/memory resources. Reviewed by: silence on -net
Diffstat (limited to 'sys/pci/if_xl.c')
-rw-r--r--sys/pci/if_xl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/pci/if_xl.c b/sys/pci/if_xl.c
index 700c98d..95edcfa 100644
--- a/sys/pci/if_xl.c
+++ b/sys/pci/if_xl.c
@@ -3169,7 +3169,8 @@ xl_stop(struct xl_softc *sc)
sc->xl_cdata.xl_rx_chain[i].xl_mbuf = NULL;
}
}
- bzero(sc->xl_ldata.xl_rx_list, XL_RX_LIST_SZ);
+ if (sc->xl_ldata.xl_rx_list != NULL)
+ bzero(sc->xl_ldata.xl_rx_list, XL_RX_LIST_SZ);
/*
* Free the TX list buffers.
*/
@@ -3183,7 +3184,8 @@ xl_stop(struct xl_softc *sc)
sc->xl_cdata.xl_tx_chain[i].xl_mbuf = NULL;
}
}
- bzero(sc->xl_ldata.xl_tx_list, XL_TX_LIST_SZ);
+ if (sc->xl_ldata.xl_tx_list != NULL)
+ bzero(sc->xl_ldata.xl_tx_list, XL_TX_LIST_SZ);
ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
}
OpenPOWER on IntegriCloud