[rtems-libbsd commit] dpaa: No error if MII attach failed
Sebastian Huber
sebh at rtems.org
Mon Oct 23 07:27:51 UTC 2017
Module: rtems-libbsd
Branch: master
Commit: 03d142659f3cfc65043e0c7564544eeead137e6f
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=03d142659f3cfc65043e0c7564544eeead137e6f
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Wed May 24 13:15:14 2017 +0200
dpaa: No error if MII attach failed
---
.../sys/powerpc/drivers/net/ethernet/freescale/dpaa/if_fmanmac.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/rtemsbsd/sys/powerpc/drivers/net/ethernet/freescale/dpaa/if_fmanmac.c b/rtemsbsd/sys/powerpc/drivers/net/ethernet/freescale/dpaa/if_fmanmac.c
index 1d367b9..e5c1183 100644
--- a/rtemsbsd/sys/powerpc/drivers/net/ethernet/freescale/dpaa/if_fmanmac.c
+++ b/rtemsbsd/sys/powerpc/drivers/net/ethernet/freescale/dpaa/if_fmanmac.c
@@ -451,10 +451,9 @@ fman_mac_dev_attach(device_t dev)
error = mii_attach(dev, &sc->miibus, ifp,
fman_mac_media_change, fman_mac_media_status,
BMSR_DEFCAPMASK, phy_dev->mdio.addr, MII_OFFSET_ANY, 0);
- if (error != 0) {
- goto error_2;
+ if (error == 0) {
+ sc->mii_softc = device_get_softc(sc->miibus);
}
- sc->mii_softc = device_get_softc(sc->miibus);
}
sc->mac_dev.net_dev.ifp = ifp;
@@ -466,7 +465,6 @@ fman_mac_dev_attach(device_t dev)
return (0);
-error_2:
if_free(ifp);
error_1:
uma_zdestroy(sc->sgt_zone);
More information about the vc
mailing list