summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorjh <jh@FreeBSD.org>2010-12-12 08:52:13 +0000
committerjh <jh@FreeBSD.org>2010-12-12 08:52:13 +0000
commitbb9ca91194363731e3daf811eb010cbcbdda2c3f (patch)
treea12f22675cad7bc1ccfedba94e0f021a10b15bbe /sys/fs
parentd381cdd7a8bd7a3f2a38034d4900002747c08ae8 (diff)
downloadFreeBSD-src-bb9ca91194363731e3daf811eb010cbcbdda2c3f.zip
FreeBSD-src-bb9ca91194363731e3daf811eb010cbcbdda2c3f.tar.gz
Handle the special ruleset 0 in devfs_ruleset_use(). An attempt set the
current ruleset to 0 with command "devfs ruleset 0" triggered a KASSERT in devfs_ruleset_create(). PR: kern/125030 Submitted by: Mateusz Guzik
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/devfs/devfs_rule.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/fs/devfs/devfs_rule.c b/sys/fs/devfs/devfs_rule.c
index 3d01f45..d3a3ef3 100644
--- a/sys/fs/devfs/devfs_rule.c
+++ b/sys/fs/devfs/devfs_rule.c
@@ -742,6 +742,11 @@ devfs_ruleset_use(devfs_rsnum rsnum, struct devfs_mount *dm)
devfs_ruleset_reap(cds);
}
+ if (rsnum == 0) {
+ dm->dm_ruleset = 0;
+ return (0);
+ }
+
ds = devfs_ruleset_bynum(rsnum);
if (ds == NULL)
ds = devfs_ruleset_create(rsnum);
OpenPOWER on IntegriCloud