summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_bus.c
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2005-04-03 22:23:18 +0000
committernjl <njl@FreeBSD.org>2005-04-03 22:23:18 +0000
commitd126ccab5aba0f029a34f388f8a1dfabb15f16ab (patch)
treeeec4979ca747e81b7f981c53f53e913023b5a9fb /sys/kern/subr_bus.c
parent8e90cdc27be6a36d3316a10c4f29cf3159ec670c (diff)
downloadFreeBSD-src-d126ccab5aba0f029a34f388f8a1dfabb15f16ab.zip
FreeBSD-src-d126ccab5aba0f029a34f388f8a1dfabb15f16ab.tar.gz
maxunit is actually one higher than the greatest currently-allocated unit
in a devclass. All the other uses of maxunit are correct and this one was safe since it checks the return value of devclass_get_device(), which would always say that the highest unit device doesn't exist. Reviewed by: dfr MFC after: 3 days
Diffstat (limited to 'sys/kern/subr_bus.c')
-rw-r--r--sys/kern/subr_bus.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
index 306e0d3..45d1718 100644
--- a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -1590,7 +1590,7 @@ device_find_child(device_t dev, const char *classname, int unit)
if (child && child->parent == dev)
return (child);
} else {
- for (unit = 0; unit <= devclass_get_maxunit(dc); unit++) {
+ for (unit = 0; unit < devclass_get_maxunit(dc); unit++) {
child = devclass_get_device(dc, unit);
if (child && child->parent == dev)
return (child);
OpenPOWER on IntegriCloud