summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2012-10-20 19:13:26 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2012-10-20 19:13:26 +0000
commit28c7a54c1c98748c7cc989decd0ca1caf9365a43 (patch)
treede3256c20e8f2639a91f146798611baaae246517
parent16b9274883e09c1e16ec08ea6fefe6d3b3e9be9e (diff)
driver xxactivate() functins are run even if a driver xxattach() has
"failed"; no indication is given up to the autoconf framework since xxattach() returns void. Until this situation is improved, there are a handful of drivers which must use driver-specific checks in xxactivate() to see if the xxattach() function succeeded or failed. Add such a check here. ok kettenis
-rw-r--r--sys/dev/pci/ehci_pci.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/pci/ehci_pci.c b/sys/dev/pci/ehci_pci.c
index 11565cf2531..80dc2ae3221 100644
--- a/sys/dev/pci/ehci_pci.c
+++ b/sys/dev/pci/ehci_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ehci_pci.c,v 1.24 2012/10/08 21:47:50 deraadt Exp $ */
+/* $OpenBSD: ehci_pci.c,v 1.25 2012/10/20 19:13:25 deraadt Exp $ */
/* $NetBSD: ehci_pci.c,v 1.15 2004/04/23 21:13:06 itojun Exp $ */
/*
@@ -237,6 +237,10 @@ ehci_pci_activate(struct device *self, int act)
struct ehci_pci_softc *sc = (struct ehci_pci_softc *)self;
int rv;
+ /* ehci_pci_attach previously failed in some way */
+ if (sc->sc.sc_child == NULL)
+ return (0);
+
switch (act) {
case DVACT_RESUME:
ehci_pci_takecontroller(sc, 1);