summaryrefslogtreecommitdiffstats
path: root/sys/dev/softraid.c
diff options
context:
space:
mode:
authormatthew <matthew@openbsd.org>2011-07-03 15:41:32 +0000
committermatthew <matthew@openbsd.org>2011-07-03 15:41:32 +0000
commitad2c3f85f9a39b3addea79562d9e2bdd4e7a5715 (patch)
treea09bf7d62350f902916cc7292dcf21f3376acbc1 /sys/dev/softraid.c
parentIn pthread_key_delete(), only scan other threads if the key was allocated (diff)
downloadwireguard-openbsd-ad2c3f85f9a39b3addea79562d9e2bdd4e7a5715.tar.xz
wireguard-openbsd-ad2c3f85f9a39b3addea79562d9e2bdd4e7a5715.zip
Call config_detach() on the child scsibus in sr_detach().
ok jsing@
Diffstat (limited to 'sys/dev/softraid.c')
-rw-r--r--sys/dev/softraid.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c
index cb64a8c9497..42078b9ec16 100644
--- a/sys/dev/softraid.c
+++ b/sys/dev/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.234 2011/07/02 17:39:12 jsing Exp $ */
+/* $OpenBSD: softraid.c,v 1.235 2011/07/03 15:41:32 matthew Exp $ */
/*
* Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -1678,9 +1678,17 @@ sr_attach(struct device *parent, struct device *self, void *aux)
int
sr_detach(struct device *self, int flags)
{
-#ifndef SMALL_KERNEL
struct sr_softc *sc = (void *)self;
+ int rv;
+
+ if (sc->sc_scsibus != NULL) {
+ rv = config_detach((struct device *)sc->sc_scsibus, flags);
+ if (rv != 0)
+ return (rv);
+ sc->sc_scsibus = NULL;
+ }
+#ifndef SMALL_KERNEL
sensordev_deinstall(&sc->sc_sensordev);
#endif /* SMALL_KERNEL */