summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorClaudiu Manoil <claudiu.manoil@freescale.com>2013-12-10 15:21:04 +0200
committerJoe Hershberger <joe.hershberger@ni.com>2015-01-30 15:55:00 -0600
commit7f233c05573fabe8ff1ed7f22c269cdfdfc30529 (patch)
tree8e43d3d7147bdc9ebdba2f8218461e30e0623f6d /drivers/net
parent2af13d6b6265a6700c4f65597410b769895024bf (diff)
downloadu-boot-imx-7f233c05573fabe8ff1ed7f22c269cdfdfc30529.zip
u-boot-imx-7f233c05573fabe8ff1ed7f22c269cdfdfc30529.tar.gz
u-boot-imx-7f233c05573fabe8ff1ed7f22c269cdfdfc30529.tar.bz2
net: tsec: Fix NULL access in case init_phy() fails
If the PHY is not recognized don't access phydev (NULL) and return 0 to signal failure. Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com> Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/tsec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
index 79d6561..dcdba4e 100644
--- a/drivers/net/tsec.c
+++ b/drivers/net/tsec.c
@@ -597,6 +597,8 @@ static int init_phy(struct eth_device *dev)
tsec_configure_serdes(priv);
phydev = phy_connect(priv->bus, priv->phyaddr, dev, priv->interface);
+ if (!phydev)
+ return 0;
phydev->supported &= supported;
phydev->advertising = phydev->supported;