phy: ti: omap-usb2: Fix refcount leak in omap_usb2_probe
PATCH 1/1 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 <[email protected]>
--- drivers/phy/ti/phy-omap-usb2.c | 1 + 1 file changed, 1 insertion(+)
drivers/phy/ti/phy-omap-usb2.c +1 -0
@@ -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 ;
Signature · 7 lines
2.25.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Quoted 25 lines · Miaoqian Lin
of_parse_phandle()returns a node pointer with refcount incremented, we should useof_node_put()on it when done. Add missingof_node_put()to avoid refcount leak.Fixes 478b6c7436c2 ("usb: phy: omap-usb2: Don't use omap_get_control_dev()")Signed-off-by Miaoqian Lin <[email protected]>--- drivers/phy/ti/phy-omap-usb2.c | 1 + 1 file changed, 1 insertion(+)drivers/phy/ti/phy-omap-usb2.c +1
-0@@ -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 ;Signature · 1 line
2.25.1
Reviewed-by Liam Beguin <[email protected]>
Thanks!
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy