net: mv643xx_eth: potential NULL dereference in probe()
We assume that "mp->phy" can be NULL a couple lines before the
dereference.
Fixes: 1cce16d37d
('net: mv643xx_eth: Add missing phy_addr_set in DT mode')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
64b8c8e573
commit
6115c11fe1
1 changed files with 2 additions and 1 deletions
|
@ -2890,7 +2890,8 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
|
||||||
PHY_INTERFACE_MODE_GMII);
|
PHY_INTERFACE_MODE_GMII);
|
||||||
if (!mp->phy)
|
if (!mp->phy)
|
||||||
err = -ENODEV;
|
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) {
|
} else if (pd->phy_addr != MV643XX_ETH_PHY_NONE) {
|
||||||
mp->phy = phy_scan(mp, pd->phy_addr);
|
mp->phy = phy_scan(mp, pd->phy_addr);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue