aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2001-03-20 13:24:24 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2001-03-20 13:24:24 +0000
commit15b6f00fd10791bc4ce1c389da6672100c0a11bb (patch)
treef1bd467fff0b7901a2af5f19d5de568ee54f1b3a
parent53233f9499879c60e4f8a83ce4c0d3f7385e3517 (diff)
downloadsrc-15b6f00fd10791bc4ce1c389da6672100c0a11bb.tar.gz
src-15b6f00fd10791bc4ce1c389da6672100c0a11bb.zip
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.
Notes
Notes: svn path=/head/; revision=74522
-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 86185f7e3ec6..c40447bbabbc 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));
}