summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorMiaoqian Lin <linmq006@gmail.com>2022-12-29 09:29:25 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-14 12:16:47 +0300
commit106d0d33c9d1ec4ddeeffc1fdc717ff09953d4ed (patch)
tree9147b619b5fa1bdb8165d4845da9d44b01958526 /drivers/net
parent398e14bb735d92097215ff0bf1949b78c8421c81 (diff)
downloadlinux-106d0d33c9d1ec4ddeeffc1fdc717ff09953d4ed.tar.xz
net: phy: xgmiitorgmii: Fix refcount leak in xgmiitorgmii_probe
[ Upstream commit d039535850ee47079d59527e96be18d8e0daa84b ] of_phy_find_device() return device node with refcount incremented. Call put_device() to relese it when not needed anymore. Fixes: ab4e6ee578e8 ("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>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/phy/xilinx_gmii2rgmii.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/phy/xilinx_gmii2rgmii.c b/drivers/net/phy/xilinx_gmii2rgmii.c
index 151c2a3f0b3a..7a78dfdfa5bd 100644
--- a/drivers/net/phy/xilinx_gmii2rgmii.c
+++ b/drivers/net/phy/xilinx_gmii2rgmii.c
@@ -82,6 +82,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;
}