From bb9ca91194363731e3daf811eb010cbcbdda2c3f Mon Sep 17 00:00:00 2001 From: jh Date: Sun, 12 Dec 2010 08:52:13 +0000 Subject: [PATCH] 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 --- sys/fs/devfs/devfs_rule.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/fs/devfs/devfs_rule.c b/sys/fs/devfs/devfs_rule.c index 3d01f454c874..d3a3ef36dac1 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);