summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-02-23 08:42:55 +0000
committerphk <phk@FreeBSD.org>2004-02-23 08:42:55 +0000
commit7c172839f55d7fca9ccb63111fc7e87e995ba09f (patch)
treece9a475aa05fbf6f24be127b43fa7569e3b99980
parent4f8f2510fd7c7f2b48bfb91c1b0841adda523542 (diff)
downloadFreeBSD-src-7c172839f55d7fca9ccb63111fc7e87e995ba09f.zip
FreeBSD-src-7c172839f55d7fca9ccb63111fc7e87e995ba09f.tar.gz
Fix two oversights here: don't trash the freelist, and properly cleanup
the cdevsw{}. Submitted by: tegge
-rw-r--r--sys/kern/kern_conf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c
index 1f8db46..8f8d1a4 100644
--- a/sys/kern/kern_conf.c
+++ b/sys/kern/kern_conf.c
@@ -287,6 +287,7 @@ allocdev(void)
if (LIST_FIRST(&dev_free)) {
si = LIST_FIRST(&dev_free);
+ LIST_REMOVE(si, si_hash);
} else if (stashed >= DEVT_STASH) {
MALLOC(si, struct cdev *, sizeof(*si), M_DEVT,
M_USE_RESERVE | M_ZERO | M_WAITOK);
@@ -399,7 +400,9 @@ fini_cdevsw(struct cdevsw *devsw)
reserved_majors[devsw->d_maj] = 0;
devsw->d_maj = MAJOR_AUTO;
devsw->d_flags &= ~D_ALLOCMAJ;
- }
+ } else if (devsw->d_maj == 0)
+ devsw->d_maj = 256;
+ devsw->d_flags &= ~D_INIT;
}
static void
OpenPOWER on IntegriCloud