summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2009-11-23 23:49:46 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2009-11-23 23:49:46 +0000
commitb11a20d63831ec2053d98d10cc75652f24e38bdc (patch)
tree0ff93cdda35498d87f9c0ee39672028d24796085
parent4940646a8462a627b7f9a58eb7d5ad1642687b8c (diff)
in detach, get rid of powerhook before doing sleeping operations
-rw-r--r--sys/dev/ic/rtl81x9.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/ic/rtl81x9.c b/sys/dev/ic/rtl81x9.c
index a8e3a906527..a1ec817781f 100644
--- a/sys/dev/ic/rtl81x9.c
+++ b/sys/dev/ic/rtl81x9.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtl81x9.c,v 1.67 2009/08/10 20:29:54 deraadt Exp $ */
+/* $OpenBSD: rtl81x9.c,v 1.68 2009/11/23 23:49:45 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -1415,6 +1415,9 @@ rl_detach(struct rl_softc *sc)
/* Unhook our tick handler. */
timeout_del(&sc->sc_tick_tmo);
+ if (sc->sc_pwrhook != NULL)
+ powerhook_disestablish(sc->sc_pwrhook);
+
/* Detach any PHYs we might have. */
if (LIST_FIRST(&sc->sc_mii.mii_phys) != NULL)
mii_detach(&sc->sc_mii, MII_PHY_ANY, MII_OFFSET_ANY);
@@ -1425,9 +1428,6 @@ rl_detach(struct rl_softc *sc)
ether_ifdetach(ifp);
if_detach(ifp);
- if (sc->sc_pwrhook != NULL)
- powerhook_disestablish(sc->sc_pwrhook);
-
return (0);
}