diff mbox series

[2/2] phy: tegra: xusb: fix device node release in tegra210_xusb_padctl_probe

Message ID 20241028-phy-tegra-xusb-tegra210-put_device-v1-2-28f74368c9ba@gmail.com
State New
Headers show
Series phy: tegra: xusb: fix device(_node) release in tegra210_xusb_padctl_probe | expand

Commit Message

Javier Carrasco Oct. 28, 2024, 10:33 p.m. UTC
A device_node acquired via of_parse_phandle() needs a call to
of_node_put() when the it is no longer required to decrement its
refcount and avoid leaking the resource.

Add the missing call to of_node_put() as soon as 'np' is no longer
required.

Cc: stable@vger.kernel.org
Fixes: 2d1021487273 ("phy: tegra: xusb: Add wake/sleepwalk for Tegra210")
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
 drivers/phy/tegra/xusb-tegra210.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/phy/tegra/xusb-tegra210.c b/drivers/phy/tegra/xusb-tegra210.c
index 9c7fdd29b7c4..a77127d6c4fa 100644
--- a/drivers/phy/tegra/xusb-tegra210.c
+++ b/drivers/phy/tegra/xusb-tegra210.c
@@ -3164,6 +3164,7 @@  tegra210_xusb_padctl_probe(struct device *dev,
 	}
 
 	pdev = of_find_device_by_node(np);
+	of_node_put(np);
 	if (!pdev) {
 		dev_warn(dev, "PMC device is not available\n");
 		goto out;