[PATCH 2/2] net: fec_imx: check return value of registration functions

Sascha Hauer s.hauer at pengutronix.de
Wed May 21 05:19:37 PDT 2014


We do not care about releasing the resources in the error
path, but at least check the return value of eth_register
and mdiobus_register.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/net/fec_imx.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
index 714f8f2..808bf8f 100644
--- a/drivers/net/fec_imx.c
+++ b/drivers/net/fec_imx.c
@@ -732,9 +732,14 @@ static int fec_probe(struct device_d *dev)
 	fec->miibus.priv = fec;
 	fec->miibus.parent = dev;
 
-	mdiobus_register(&fec->miibus);
+	ret = mdiobus_register(&fec->miibus);
+	if (ret)
+		return ret;
+
+	ret = eth_register(edev);
+	if (ret)
+		return ret;
 
-	eth_register(edev);
 	return 0;
 
 err_free:
-- 
2.0.0.rc0




More information about the barebox mailing list