Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Mar 2009 17:36:19 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r190446 - head/sys/dev/ed
Message-ID:  <200903261736.n2QHaJhZ024249@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903261736.n2QHaJhZ024249>