From ba32f0ff83feb3d5846164437688ceebeec38c7e Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 26 Mar 2009 17:36:19 +0000 Subject: [PATCH] Allow the attach routine to fail gracefully and not panic the system. --- sys/dev/ed/if_ed.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c index cbfabd2447fc..13a54682b5ff 100644 --- a/sys/dev/ed/if_ed.c +++ b/sys/dev/ed/if_ed.c @@ -389,7 +389,8 @@ ed_detach(device_t dev) callout_drain(&sc->tick_ch); ether_ifdetach(ifp); } - bus_teardown_intr(dev, sc->irq_res, sc->irq_handle); + if (sc->irq_res != NULL && sc->irq_handle) + bus_teardown_intr(dev, sc->irq_res, sc->irq_handle); ed_release_resources(dev); ED_LOCK_DESTROY(sc); bus_generic_detach(dev);