summaryrefslogtreecommitdiffstats
path: root/sys/dev/ic/aic79xx_openbsd.c
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2006-05-22 20:35:12 +0000
committerkrw <krw@openbsd.org>2006-05-22 20:35:12 +0000
commitd8ed46e47baf955136da5c04fb1401169e5ff07e (patch)
treef730da70eb7a085fac3d484c7fee375a0eb6b2ac /sys/dev/ic/aic79xx_openbsd.c
parentAdd support for raid 50 and 10 in bio. (diff)
downloadwireguard-openbsd-d8ed46e47baf955136da5c04fb1401169e5ff07e.tar.xz
wireguard-openbsd-d8ed46e47baf955136da5c04fb1401169e5ff07e.zip
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/aic79xx_openbsd.c')
-rw-r--r--sys/dev/ic/aic79xx_openbsd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/ic/aic79xx_openbsd.c b/sys/dev/ic/aic79xx_openbsd.c
index c32948cd517..dae58bc9e3c 100644
--- a/sys/dev/ic/aic79xx_openbsd.c
+++ b/sys/dev/ic/aic79xx_openbsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aic79xx_openbsd.c,v 1.24 2006/03/04 14:20:37 krw Exp $ */
+/* $OpenBSD: aic79xx_openbsd.c,v 1.25 2006/05/22 20:35:12 krw Exp $ */
/*
* Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom
@@ -639,7 +639,8 @@ ahd_detach(struct device *self, int flags)
if (ahd->sc_child != NULL)
rv = config_detach((void *)ahd->sc_child, flags);
- shutdownhook_disestablish(ahd->shutdown_hook);
+ if (ahd->shutdown_hook != NULL)
+ shutdownhook_disestablish(ahd->shutdown_hook);
ahd_free(ahd);