summaryrefslogtreecommitdiff
path: root/sys/dev/ic/if_wi.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/if_wi.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/if_wi.c')
-rw-r--r--sys/dev/ic/if_wi.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/ic/if_wi.c b/sys/dev/ic/if_wi.c
index 049ef897ab3..9f9f5b52bf2 100644
--- a/sys/dev/ic/if_wi.c
+++ b/sys/dev/ic/if_wi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi.c,v 1.128 2006/04/10 00:58:52 deraadt Exp $ */
+/* $OpenBSD: if_wi.c,v 1.129 2006/05/22 20:35:12 krw Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -127,7 +127,7 @@ u_int32_t widebug = WIDEBUG;
#if !defined(lint) && !defined(__OpenBSD__)
static const char rcsid[] =
- "$OpenBSD: if_wi.c,v 1.128 2006/04/10 00:58:52 deraadt Exp $";
+ "$OpenBSD: if_wi.c,v 1.129 2006/05/22 20:35:12 krw Exp $";
#endif /* lint */
#ifdef foo
@@ -2473,7 +2473,8 @@ wi_detach(struct wi_softc *sc)
if (sc->wi_flags & WI_FLAGS_ATTACHED) {
sc->wi_flags &= ~WI_FLAGS_ATTACHED;
- shutdownhook_disestablish(sc->sc_sdhook);
+ if (sc->sc_sdhook != NULL)
+ shutdownhook_disestablish(sc->sc_sdhook);
}
}