summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 b63b926..4179fc7 100644
--- a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -1598,7 +1598,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