[U-Boot] [PATCH 08/14] net: gem: Check if priv->phydev is valid

Michal Simek michal.simek at xilinx.com
Mon Nov 30 16:05:24 CET 2015


Check return value.

Signed-off-by: Michal Simek <michal.simek at xilinx.com>
---

 drivers/net/zynq_gem.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c
index 86bb75905071..d5540ec2155c 100644
--- a/drivers/net/zynq_gem.c
+++ b/drivers/net/zynq_gem.c
@@ -329,6 +329,8 @@ static int zynq_phy_init(struct eth_device *dev)
 
 	priv->phydev = phy_connect(priv->bus, priv->phyaddr, dev,
 				   priv->interface);
+	if (!priv->phydev)
+		return -ENODEV;
 
 	priv->phydev->supported = supported | ADVERTISED_Pause |
 				  ADVERTISED_Asym_Pause;
-- 
1.9.1



More information about the U-Boot mailing list