Restore the behavior of returning the total number of units by

unconditionally incrementing i in the loop;

Reported by:	cem
MFC with:	r330880
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D14685
This commit is contained in:
brooks 2018-03-15 16:37:43 +00:00
parent 1822819eaa
commit 94a6309b43

View File

@ -1765,7 +1765,8 @@ err_after_new:
i = 1; i = 1;
LIST_FOREACH(sc, &md_softc_list, list) { LIST_FOREACH(sc, &md_softc_list, list) {
if (i < MDNPAD - 1) if (i < MDNPAD - 1)
mdio->md_pad[i++] = sc->unit; mdio->md_pad[i] = sc->unit;
i++;
} }
mdio->md_pad[MIN(i, MDNPAD - 1)] = -1; mdio->md_pad[MIN(i, MDNPAD - 1)] = -1;
mdio->md_pad[0] = i - 1; mdio->md_pad[0] = i - 1;