aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mii/mlphy.c
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2008-08-23 15:29:28 +0000
committerWarner Losh <imp@FreeBSD.org>2008-08-23 15:29:28 +0000
commit373444e7a1dcc6a0d93e0b61b998a85fa3c4e158 (patch)
tree65680e38e03029a4f94a822241034e89092e1540 /sys/dev/mii/mlphy.c
parent6356dba0b403daa023dec24559ab1f8e602e4f14 (diff)
Notes
Diffstat (limited to 'sys/dev/mii/mlphy.c')
-rw-r--r--sys/dev/mii/mlphy.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/dev/mii/mlphy.c b/sys/dev/mii/mlphy.c
index 9eba9da899e05..d44d36f2cf173 100644
--- a/sys/dev/mii/mlphy.c
+++ b/sys/dev/mii/mlphy.c
@@ -194,15 +194,15 @@ mlphy_service(xsc, mii, cmd)
* See if there's another PHY on this bus with us.
* If so, we may need it for 10Mbps modes.
*/
- devs = 0;
- device_get_children(msc->ml_mii.mii_dev, &devlist, &devs);
- for (i = 0; i < devs; i++) {
- if (strcmp(device_get_name(devlist[i]), "mlphy")) {
- other = device_get_softc(devlist[i]);
- break;
+ if (device_get_children(msc->ml_mii.mii_dev, &devlist, &devs) == 0) {
+ for (i = 0; i < devs; i++) {
+ if (strcmp(device_get_name(devlist[i]), "mlphy")) {
+ other = device_get_softc(devlist[i]);
+ break;
+ }
}
+ free(devlist, M_TEMP);
}
- free(devlist, M_TEMP);
switch (cmd) {
case MII_POLLSTAT: