summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/kern_conf.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c
index d578077..4d8e74b 100644
--- a/sys/kern/kern_conf.c
+++ b/sys/kern/kern_conf.c
@@ -375,6 +375,15 @@ make_dev(struct cdevsw *devsw, int minor, uid_t uid, gid_t gid, int perms, const
}
dev = makedev(devsw->d_maj, minor);
+ if (dev->si_flags & SI_CHEAPCLONE &&
+ dev->si_flags & SI_NAMED &&
+ dev->si_devsw == devsw) {
+ /*
+ * This is allowed as it removes races and generally
+ * simplifies cloning devices.
+ */
+ return (dev);
+ }
if (dev->si_flags & SI_NAMED) {
printf( "WARNING: Driver mistake: repeat make_dev(\"%s\")\n",
dev->si_name);
OpenPOWER on IntegriCloud