kernel - VN - add missing disk_destroy() in module unload path
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 2 Mar 2010 00:07:25 +0000 (16:07 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 2 Mar 2010 00:07:25 +0000 (16:07 -0800)
* The module unload was leaving the disk list corrupted.  Add a missing
  disk_destroy() call.

* Fixes certain bulk-build issues (apparently the bulk build tries to
  unload and reload the VN driver at some point for reasons unknown).

sys/dev/disk/vn/vn.c

index 014c1f8..20ba904 100644 (file)
@@ -886,6 +886,7 @@ vn_modevent(module_t mod, int type, void *data)
                        if (vn->sc_flags & VNF_INITED)
                                vnclear(vn);
                        /* Cleanup all cdev_t's that refer to this unit */
+                       disk_destroy(&vn->sc_disk);
                        while ((dev = vn->sc_devlist) != NULL) {
                                vn->sc_devlist = dev->si_drv2;
                                dev->si_drv1 = dev->si_drv2 = NULL;