Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 78b0b1ff authored by Miaoqian Lin's avatar Miaoqian Lin Committed by Greg Kroah-Hartman
Browse files

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: ab4e6ee5 ("net: phy: xgmiitorgmii: Check phy_driver ready before accessing")
Signed-off-by: default avatarMiaoqian Lin <linmq006@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 0294286a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -91,6 +91,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;
	}