summaryrefslogtreecommitdiff
path: root/sys/dev/pcmcia
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2006-05-22 20:35:13 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2006-05-22 20:35:13 +0000
commit657c3498f0f1f12424b08b44ee1ab824bc20ba62 (patch)
tree6059bbe140fff90fbc52e205a78ecb62c6ecad0d /sys/dev/pcmcia
parent015937de55f300730d284d2cf72704203aad00eb (diff)
Attach routines can fail before calling *hook_establish(), and they
often rely on the detach routine for cleanup. So be consistant and careful by checking for a NULL hook before calling *hook_disestablish in detach routines. ok mickey@ brad@ dlg@
Diffstat (limited to 'sys/dev/pcmcia')
-rw-r--r--sys/dev/pcmcia/if_ray.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/pcmcia/if_ray.c b/sys/dev/pcmcia/if_ray.c
index 1f7acae9c00..bf5e1a4712b 100644
--- a/sys/dev/pcmcia/if_ray.c
+++ b/sys/dev/pcmcia/if_ray.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ray.c,v 1.31 2006/03/25 22:41:46 djm Exp $ */
+/* $OpenBSD: if_ray.c,v 1.32 2006/05/22 20:35:12 krw Exp $ */
/* $NetBSD: if_ray.c,v 1.21 2000/07/05 02:35:54 onoe Exp $ */
/*
@@ -717,8 +717,10 @@ ray_detach(self, flags)
ether_ifdetach(ifp);
if_detach(ifp);
- powerhook_disestablish(sc->sc_pwrhook);
- shutdownhook_disestablish(sc->sc_sdhook);
+ if (sc->sc_pwrhook != NULL)
+ powerhook_disestablish(sc->sc_pwrhook);
+ if (sc->sc_sdhook != NULL)
+ shutdownhook_disestablish(sc->sc_sdhook);
return (0);
}