Skip to content
Snippets Groups Projects
Commit 7f233c05 authored by Claudiu Manoil's avatar Claudiu Manoil Committed by Joe Hershberger
Browse files

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: default avatarClaudiu Manoil <claudiu.manoil@freescale.com>
Signed-off-by: default avatarJoe Hershberger <joe.hershberger@ni.com>
parent 2af13d6b
No related branches found
No related tags found
No related merge requests found
...@@ -597,6 +597,8 @@ static int init_phy(struct eth_device *dev) ...@@ -597,6 +597,8 @@ static int init_phy(struct eth_device *dev)
tsec_configure_serdes(priv); tsec_configure_serdes(priv);
phydev = phy_connect(priv->bus, priv->phyaddr, dev, priv->interface); phydev = phy_connect(priv->bus, priv->phyaddr, dev, priv->interface);
if (!phydev)
return 0;
phydev->supported &= supported; phydev->supported &= supported;
phydev->advertising = phydev->supported; phydev->advertising = phydev->supported;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment