提交 fa6114d4 编写于 作者: N Nathan Sullivan 提交者: David S. Miller

net: macb: NULL out phydev after removing mdio bus

To ensure the dev->phydev pointer is not used after becoming invalid in
mdiobus_unregister, set it to NULL. This happens when removing the macb
driver without first taking its interface down, since unregister_netdev
will end up calling macb_close.
Signed-off-by: NXander Huff <xander.huff@ni.com>
Signed-off-by: NNathan Sullivan <nathan.sullivan@ni.com>
Signed-off-by: NBrad Mouring <brad.mouring@ni.com>
Reviewed-by: NMoritz Fischer <moritz.fischer@ettus.com>
Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 912e27e8
...@@ -3117,6 +3117,7 @@ static int macb_remove(struct platform_device *pdev) ...@@ -3117,6 +3117,7 @@ static int macb_remove(struct platform_device *pdev)
if (dev->phydev) if (dev->phydev)
phy_disconnect(dev->phydev); phy_disconnect(dev->phydev);
mdiobus_unregister(bp->mii_bus); mdiobus_unregister(bp->mii_bus);
dev->phydev = NULL;
mdiobus_free(bp->mii_bus); mdiobus_free(bp->mii_bus);
/* Shutdown the PHY if there is a GPIO reset */ /* Shutdown the PHY if there is a GPIO reset */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册