summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_conf.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2001-03-20 13:24:24 +0000
committerphk <phk@FreeBSD.org>2001-03-20 13:24:24 +0000
commit74b2fb2f6943f9df0d3cb1d6fe049ae701cef3c6 (patch)
treee5f9b99ac669e7123fbecfe92bdd1b7ad2b191f6 /sys/kern/kern_conf.c
parent47ba5e6d34e69c881327719f51228e3fff9a09e2 (diff)
downloadFreeBSD-src-74b2fb2f6943f9df0d3cb1d6fe049ae701cef3c6.zip
FreeBSD-src-74b2fb2f6943f9df0d3cb1d6fe049ae701cef3c6.tar.gz
Add a KASSERT on unit2minor() so that we catch it if people try to pass
us unit numbers which doesn't fit in 24 bits.
Diffstat (limited to 'sys/kern/kern_conf.c')
-rw-r--r--sys/kern/kern_conf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c
index 86185f7..c40447b 100644
--- a/sys/kern/kern_conf.c
+++ b/sys/kern/kern_conf.c
@@ -159,6 +159,7 @@ int
unit2minor(int unit)
{
+ KASSERT(unit <= 0xffffff, ("Invalid unit (%d) in unit2minor", unit));
return ((unit & 0xff) | ((unit << 8) & ~0xffff));
}
OpenPOWER on IntegriCloud