提交 d0395358 编写于 作者: M Miaoqian Lin 提交者: David S. Miller

net: phy: xgmiitorgmii: Fix refcount leak in xgmiitorgmii_probe

of_phy_find_device() return device node with refcount incremented.
Call put_device() to relese it when not needed anymore.

Fixes: ab4e6ee5 ("net: phy: xgmiitorgmii: Check phy_driver ready before accessing")
Signed-off-by: NMiaoqian Lin <linmq006@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 72f299b0
...@@ -105,6 +105,7 @@ static int xgmiitorgmii_probe(struct mdio_device *mdiodev) ...@@ -105,6 +105,7 @@ static int xgmiitorgmii_probe(struct mdio_device *mdiodev)
if (!priv->phy_dev->drv) { if (!priv->phy_dev->drv) {
dev_info(dev, "Attached phy not ready\n"); dev_info(dev, "Attached phy not ready\n");
put_device(&priv->phy_dev->mdio.dev);
return -EPROBE_DEFER; return -EPROBE_DEFER;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册