From: Michal Simek Date: Mon, 30 Nov 2015 13:03:37 +0000 (+0100) Subject: net: gem: Check if priv->phydev is valid X-Git-Tag: v2016.01-rc2~3^2~20 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=90c6f2e21bb980e5544b1339e7ef7038bc872968;p=oweals%2Fu-boot.git net: gem: Check if priv->phydev is valid Check return value. Signed-off-by: Michal Simek Reviewed-by: Jagan Teki --- diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c index 86bb759050..d5540ec215 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;