diff options
author | jhb <jhb@FreeBSD.org> | 2005-10-06 18:41:31 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2005-10-06 18:41:31 +0000 |
commit | 1320dea0a16d5e1b53574aa53fddde116eb8d29c (patch) | |
tree | de12e5fad51a606912e6fed4571dcfff434c35e8 /sys/dev/vx | |
parent | 80a3a8c98a407c734fe5def2897f126f4c5fbe99 (diff) | |
download | FreeBSD-src-1320dea0a16d5e1b53574aa53fddde116eb8d29c.zip FreeBSD-src-1320dea0a16d5e1b53574aa53fddde116eb8d29c.tar.gz |
Fix another edge case I just noticed when committing the previous changes:
If bus_setup_intr() fails, cleanup the ifnet setup in vx_attach() by
calling ether_ifdetach() and if_free().
MFC after: 1 week
Diffstat (limited to 'sys/dev/vx')
-rw-r--r-- | sys/dev/vx/if_vx_eisa.c | 3 | ||||
-rw-r--r-- | sys/dev/vx/if_vx_pci.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/sys/dev/vx/if_vx_eisa.c b/sys/dev/vx/if_vx_eisa.c index ec67e26..459e348 100644 --- a/sys/dev/vx/if_vx_eisa.c +++ b/sys/dev/vx/if_vx_eisa.c @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include <machine/resource.h> #include <sys/rman.h> +#include <net/ethernet.h> #include <net/if.h> #include <net/if_arp.h> @@ -159,6 +160,8 @@ vx_eisa_attach(device_t dev) bad_mtx: mtx_destroy(&sc->vx_mtx); + ether_ifdetach(sc->vx_ifp); + if_free(sc->vx_ifp); bad: if (io) bus_release_resource(dev, SYS_RES_IOPORT, 0, io); diff --git a/sys/dev/vx/if_vx_pci.c b/sys/dev/vx/if_vx_pci.c index 2e358d5..dc0fea7 100644 --- a/sys/dev/vx/if_vx_pci.c +++ b/sys/dev/vx/if_vx_pci.c @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include <sys/module.h> #include <sys/socket.h> +#include <net/ethernet.h> #include <net/if.h> #include <net/if_arp.h> @@ -167,6 +168,8 @@ vx_pci_attach(device_t dev) bad_mtx: mtx_destroy(&sc->vx_mtx); + ether_ifdetach(sc->vx_ifp); + if_free(sc->vx_ifp); bad: if (sc->vx_intrhand != NULL) bus_teardown_intr(dev, sc->vx_irq, sc->vx_intrhand); |