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

Michal Simek michal.simek at xilinx.com
Thu Dec 3 15:47:56 CET 2015


Check return value.

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

Changes in v3: None
Changes in v2: None

 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