Maxunit is inclusive so fix off-by-one in previous commit.

This commit is contained in:
Nate Lawson 2005-02-08 18:03:17 +00:00
parent 5b68bf38ab
commit 7990a18c7b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=141532

View File

@ -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);