提交 7f233c05 编写于 作者: C Claudiu Manoil 提交者: Joe Hershberger

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: NClaudiu Manoil <claudiu.manoil@freescale.com>
Signed-off-by: NJoe Hershberger <joe.hershberger@ni.com>
上级 2af13d6b
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册