From 94a6309b435eb0470d2801ad90b85bab7e556f17 Mon Sep 17 00:00:00 2001 From: brooks Date: Thu, 15 Mar 2018 16:37:43 +0000 Subject: [PATCH] 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 --- sys/dev/md/md.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index 1f8d3b74447d..1b91f60825d2 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -1765,7 +1765,8 @@ xmdctlioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread i = 1; LIST_FOREACH(sc, &md_softc_list, list) { 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[0] = i - 1;