提交 65f2767a 编写于 作者: F Florian Fainelli 提交者: David S. Miller

net: phy: Add missing driver check in phy_aneg_done()

Dan's static checker caught a potential code path in phy_state_machine() where
we were not checking phydev->drv which is in phy_aneg_done().
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Fixes: 25149ef9 ("net: phy: Check phydev->drv")
Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 4e37d691
......@@ -146,7 +146,7 @@ static int phy_config_interrupt(struct phy_device *phydev, u32 interrupts)
*/
int phy_aneg_done(struct phy_device *phydev)
{
if (phydev->drv->aneg_done)
if (phydev->drv && phydev->drv->aneg_done)
return phydev->drv->aneg_done(phydev);
return genphy_aneg_done(phydev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册