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>
This commit is contained in:
parent
2af13d6b62
commit
7f233c0557
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user