[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220512043238.63252-1-linmq006@gmail.com>
Date: Thu, 12 May 2022 08:32:33 +0400
From: Miaoqian Lin <linmq006@...il.com>
To: Kishon Vijay Abraham I <kishon@...com>,
Vinod Koul <vkoul@...nel.org>,
Miaoqian Lin <linmq006@...il.com>,
Liam Beguin <liambeguin@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Roger Quadros <rogerq@...com>, linux-phy@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] phy: ti: omap-usb2: Fix refcount leak in omap_usb2_probe
of_parse_phandle() returns a node pointer with refcount
incremented, we should use of_node_put() on it when done.
Add missing of_node_put() to avoid refcount leak.
Fixes: 478b6c7436c2 ("usb: phy: omap-usb2: Don't use omap_get_control_dev()")
Signed-off-by: Miaoqian Lin <linmq006@...il.com>
---
drivers/phy/ti/phy-omap-usb2.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/phy/ti/phy-omap-usb2.c b/drivers/phy/ti/phy-omap-usb2.c
index 31a775877f6e..98133e5fc9de 100644
--- a/drivers/phy/ti/phy-omap-usb2.c
+++ b/drivers/phy/ti/phy-omap-usb2.c
@@ -421,6 +421,7 @@ static int omap_usb2_probe(struct platform_device *pdev)
}
control_pdev = of_find_device_by_node(control_node);
+ of_node_put(control_node);
if (!control_pdev) {
dev_err(&pdev->dev, "Failed to get control device\n");
return -EINVAL;
--
2.25.1
Powered by blists - more mailing lists