Author: imp
Date: Thu Mar 26 17:36:19 2009
New Revision: 190446
URL: http://svn.freebsd.org/changeset/base/190446

Log:
  Allow the attach routine to fail gracefully and not panic the system.

Modified:
  head/sys/dev/ed/if_ed.c

Modified: head/sys/dev/ed/if_ed.c
==============================================================================
--- head/sys/dev/ed/if_ed.c     Thu Mar 26 17:14:22 2009        (r190445)
+++ head/sys/dev/ed/if_ed.c     Thu Mar 26 17:36:19 2009        (r190446)
@@ -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);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to