summaryrefslogtreecommitdiffstats
path: root/sys/dev/vinum
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>2003-02-11 21:12:43 +0000
committerjoerg <joerg@FreeBSD.org>2003-02-11 21:12:43 +0000
commit4fe8424f92b3f5fcc76023408fdb0f5f07473550 (patch)
tree0f365a3bdb69f4247d688d0cc12ce63b4bea9d0c /sys/dev/vinum
parent804e8df48ccf9bd33fb01eb5df35620f06311be8 (diff)
downloadFreeBSD-src-4fe8424f92b3f5fcc76023408fdb0f5f07473550.zip
FreeBSD-src-4fe8424f92b3f5fcc76023408fdb0f5f07473550.tar.gz
Deregister the dev_clone event handler when unloading the module. Bad
things might happen otherwise. Noticed by: Michael Reifenberger <root@nihil.reifenberger.com>
Diffstat (limited to 'sys/dev/vinum')
-rw-r--r--sys/dev/vinum/vinum.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/vinum/vinum.c b/sys/dev/vinum/vinum.c
index 84056ff..d202442 100644
--- a/sys/dev/vinum/vinum.c
+++ b/sys/dev/vinum/vinum.c
@@ -73,6 +73,8 @@ struct _vinum_conf vinum_conf; /* configuration information */
dev_t vinum_daemon_dev;
dev_t vinum_super_dev;
+static eventhandler_tag dev_clone_tag;
+
/*
* Called by main() during pseudo-device attachment. All we need
* to do is allocate enough space for devices to be configured later, and
@@ -142,7 +144,7 @@ vinumattach(void *dummy)
vinum_conf.subdisks_allocated = INITIAL_SUBDISKS; /* number of sd slots allocated */
vinum_conf.subdisks_used = 0; /* and number in use */
- EVENTHANDLER_REGISTER(dev_clone, vinum_clone, 0, 1000);
+ dev_clone_tag = EVENTHANDLER_REGISTER(dev_clone, vinum_clone, 0, 1000);
/*
* See if the loader has passed us any of the
@@ -240,6 +242,8 @@ free_vinum(int cleardrive)
int i;
int drives_allocated = vinum_conf.drives_allocated;
+ EVENTHANDLER_DEREGISTER(dev_clone, dev_clone_tag);
+
if (DRIVE != NULL) {
if (cleardrive) { /* remove the vinum config */
for (i = 0; i < drives_allocated; i++)
OpenPOWER on IntegriCloud