diff options
author | imp <imp@FreeBSD.org> | 2005-09-19 03:10:21 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2005-09-19 03:10:21 +0000 |
commit | 4e70215e6bf590140205774753c8b0a1f1fe9a36 (patch) | |
tree | c3358cebc77043ea8b2a3a5036b02dad6a674b7e /sys/dev/ixgb | |
parent | 37a0bbb7e543c6b2a2f055d676d5a94f781d7738 (diff) | |
download | FreeBSD-src-4e70215e6bf590140205774753c8b0a1f1fe9a36.zip FreeBSD-src-4e70215e6bf590140205774753c8b0a1f1fe9a36.tar.gz |
Make sure that we call if_free(ifp) after bus_teardown_intr. Since we
could get an interrupt after we free the ifp, and the interrupt
handler depended on the ifp being still alive, this could, in theory,
cause a crash. Eliminate this possibility by moving the if_free to
after the bus_teardown_intr() call.
Diffstat (limited to 'sys/dev/ixgb')
-rw-r--r-- | sys/dev/ixgb/if_ixgb.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/ixgb/if_ixgb.c b/sys/dev/ixgb/if_ixgb.c index 6453262..4cb9caa 100644 --- a/sys/dev/ixgb/if_ixgb.c +++ b/sys/dev/ixgb/if_ixgb.c @@ -378,10 +378,11 @@ ixgb_detach(device_t dev) ether_ifdetach(adapter->ifp, ETHER_BPF_SUPPORTED); #else ether_ifdetach(adapter->ifp); - if_free(adapter->ifp); #endif ixgb_free_pci_resources(adapter); - +#if __FreeBSD_version >= 500000 + if_free(adapter->ifp); +#endif /* Free Transmit Descriptor ring */ if (adapter->tx_desc_base) { |