diff options
author | brian <brian@FreeBSD.org> | 2001-02-02 03:32:11 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2001-02-02 03:32:11 +0000 |
commit | 410082716c1748496cbaedaad5559d16c0882823 (patch) | |
tree | d6bc835b54d971dcba5bc1e1e3563daa466a3c59 /sys | |
parent | 546aee59243e194b2f4458332a412086b7996636 (diff) | |
download | FreeBSD-src-410082716c1748496cbaedaad5559d16c0882823.zip FreeBSD-src-410082716c1748496cbaedaad5559d16c0882823.tar.gz |
KASSERT that the minor number passed to make_dev() is valid.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_conf.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c index c8ca0c4..e6a173b 100644 --- a/sys/kern/kern_conf.c +++ b/sys/kern/kern_conf.c @@ -278,6 +278,9 @@ make_dev(struct cdevsw *devsw, int minor, uid_t uid, gid_t gid, int perms, char va_list ap; int i; + KASSERT(umajor(makeudev(devsw->d_maj, minor)) == devsw->d_maj, + ("Invalid minor (%d) in make_dev", minor)); + dev = makedev(devsw->d_maj, minor); if (dev->si_flags & SI_NAMED) { printf( "WARNING: Driver mistake: repeat make_dev(\"%s\")\n", |