[PATCH 14/18] fec_imx: Unregister MDIO when probe fails

Andrey Smirnov andrew.smirnov at gmail.com
Tue Feb 16 17:29:15 PST 2016


Signed-off-by: Andrey Smirnov <andrew.smirnov at gmail.com>
---
 drivers/net/fec_imx.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
index 0877a53..27d816f 100644
--- a/drivers/net/fec_imx.c
+++ b/drivers/net/fec_imx.c
@@ -799,14 +799,16 @@ static int fec_probe(struct device_d *dev)
 
 	ret = mdiobus_register(&fec->miibus);
 	if (ret)
-		return ret;
+		goto free_receive_packets;
 
 	ret = eth_register(edev);
 	if (ret)
-		return ret;
+		goto unregister_mdio;
 
 	return 0;
 
+unregister_mdio:
+	mdiobus_unregister(&fec->miibus);
 free_receive_packets:
 	fec_free_receive_packets(fec, FEC_RBD_NUM, FEC_MAX_PKT_SIZE);
 free_xbd:
-- 
2.5.0




More information about the barebox mailing list