summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMiaoqian Lin <linmq006@gmail.com>2022-12-29 10:29:25 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-18 09:26:40 +0100
commit53526dbc8aa6b95e9fc2ab1e29b1a9145721da24 (patch)
tree22303470c2c6233230fc06038322b4f1e69234fc /drivers
parent275c0d43d2ac8efae24017fe8e9fd15bc976333e (diff)
downloadlinux-53526dbc8aa6b95e9fc2ab1e29b1a9145721da24.tar.gz
linux-53526dbc8aa6b95e9fc2ab1e29b1a9145721da24.tar.bz2
linux-53526dbc8aa6b95e9fc2ab1e29b1a9145721da24.zip
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')
-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 aef525467af0..55157c3197bd 100644
--- a/drivers/net/phy/xilinx_gmii2rgmii.c
+++ b/drivers/net/phy/xilinx_gmii2rgmii.c
@@ -89,6 +89,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;
}