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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx
Fixes: 2d1021487273 ("phy: tegra: xusb: Add wake/sleepwalk for Tegra210")
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@xxxxxxxxx>
---
 drivers/phy/tegra/xusb-tegra210.c | 1 +
 1 file changed, 1 insertion(+)

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;

-- 
2.43.0





[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux