summaryrefslogtreecommitdiff
path: root/sys/dev/ic/an.c
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/ic/an.c
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/ic/an.c')
-rw-r--r--sys/dev/ic/an.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/ic/an.c b/sys/dev/ic/an.c
index 0fea39c67fb..7f5f47b3963 100644
--- a/sys/dev/ic/an.c
+++ b/sys/dev/ic/an.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: an.c,v 1.50 2006/04/05 14:28:20 kurt Exp $ */
+/* $OpenBSD: an.c,v 1.51 2006/05/22 20:35:12 krw Exp $ */
/* $NetBSD: an.c,v 1.34 2005/06/20 02:49:18 atatat Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -1675,7 +1675,8 @@ an_detach(struct an_softc *sc)
ifmedia_delete_instance(&sc->sc_ic.ic_media, IFM_INST_ANY);
ieee80211_ifdetach(ifp);
if_detach(ifp);
- shutdownhook_disestablish(sc->sc_sdhook);
+ if (sc->sc_sdhook != NULL)
+ shutdownhook_disestablish(sc->sc_sdhook);
splx(s);
return 0;
}