summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2015-11-30 14:03:37 +0100
committerMichal Simek <michal.simek@xilinx.com>2015-12-07 09:59:05 +0100
commit90c6f2e21bb980e5544b1339e7ef7038bc872968 (patch)
treeed38b4f508b12b4cb65a8709d1e8724b281212ba
parent68cc3bd8b2863667513008c975cc69187855317f (diff)
net: gem: Check if priv->phydev is valid
Check return value. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Jagan Teki <jteki@openedev.com>
-rw-r--r--drivers/net/zynq_gem.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c
index 86bb7590507..d5540ec2155 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;