提交 6115c11f 编写于 作者: D Dan Carpenter 提交者: David S. Miller

net: mv643xx_eth: potential NULL dereference in probe()

We assume that "mp->phy" can be NULL a couple lines before the
dereference.

Fixes: 1cce16d3 ('net: mv643xx_eth: Add missing phy_addr_set in DT mode')
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: NSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: NJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 64b8c8e5
......@@ -2890,7 +2890,8 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
PHY_INTERFACE_MODE_GMII);
if (!mp->phy)
err = -ENODEV;
phy_addr_set(mp, mp->phy->addr);
else
phy_addr_set(mp, mp->phy->addr);
} else if (pd->phy_addr != MV643XX_ETH_PHY_NONE) {
mp->phy = phy_scan(mp, pd->phy_addr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册