mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-24 19:40:21 +09:00
net: phy: xgmiitorgmii: Fix refcount leak in xgmiitorgmii_probe
[ Upstream commitd039535850] of_phy_find_device() return device node with refcount incremented. Call put_device() to relese it when not needed anymore. Fixes:ab4e6ee578("net: phy: xgmiitorgmii: Check phy_driver ready before accessing") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
191c4b94c1
commit
ee84d37a5f
@@ -105,6 +105,7 @@ static int xgmiitorgmii_probe(struct mdio_device *mdiodev)
|
||||
|
||||
if (!priv->phy_dev->drv) {
|
||||
dev_info(dev, "Attached phy not ready\n");
|
||||
put_device(&priv->phy_dev->mdio.dev);
|
||||
return -EPROBE_DEFER;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user