* [PATCH] usb: host: Fix refcount leak in ehci_hcd_ppc_of_probe
@ 2022-06-02 11:08 Miaoqian Lin
2022-06-02 14:10 ` Alan Stern
0 siblings, 1 reply; 2+ messages in thread
From: Miaoqian Lin @ 2022-06-02 11:08 UTC (permalink / raw)
To: Alan Stern, Greg Kroah-Hartman, Vitaly Bordug, Stefan Roese,
linux-usb, linux-kernel
Cc: linmq006
of_find_compatible_node() 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: 796bcae7361c ("USB: powerpc: Workaround for the PPC440EPX USBH_23 errata [take 3]")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
drivers/usb/host/ehci-ppc-of.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/host/ehci-ppc-of.c b/drivers/usb/host/ehci-ppc-of.c
index 6bbaee74f7e7..28a19693c19f 100644
--- a/drivers/usb/host/ehci-ppc-of.c
+++ b/drivers/usb/host/ehci-ppc-of.c
@@ -148,6 +148,7 @@ static int ehci_hcd_ppc_of_probe(struct platform_device *op)
} else {
ehci->has_amcc_usb23 = 1;
}
+ of_node_put(np);
}
if (of_get_property(dn, "big-endian", NULL)) {
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] usb: host: Fix refcount leak in ehci_hcd_ppc_of_probe
2022-06-02 11:08 [PATCH] usb: host: Fix refcount leak in ehci_hcd_ppc_of_probe Miaoqian Lin
@ 2022-06-02 14:10 ` Alan Stern
0 siblings, 0 replies; 2+ messages in thread
From: Alan Stern @ 2022-06-02 14:10 UTC (permalink / raw)
To: Miaoqian Lin
Cc: Greg Kroah-Hartman, Vitaly Bordug, Stefan Roese, linux-usb, linux-kernel
On Thu, Jun 02, 2022 at 03:08:49PM +0400, Miaoqian Lin wrote:
> of_find_compatible_node() 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: 796bcae7361c ("USB: powerpc: Workaround for the PPC440EPX USBH_23 errata [take 3]")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
Acked-by: Alan Stern <stern@rowland.harvard.edu>
> drivers/usb/host/ehci-ppc-of.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/usb/host/ehci-ppc-of.c b/drivers/usb/host/ehci-ppc-of.c
> index 6bbaee74f7e7..28a19693c19f 100644
> --- a/drivers/usb/host/ehci-ppc-of.c
> +++ b/drivers/usb/host/ehci-ppc-of.c
> @@ -148,6 +148,7 @@ static int ehci_hcd_ppc_of_probe(struct platform_device *op)
> } else {
> ehci->has_amcc_usb23 = 1;
> }
> + of_node_put(np);
> }
>
> if (of_get_property(dn, "big-endian", NULL)) {
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-06-02 14:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-02 11:08 [PATCH] usb: host: Fix refcount leak in ehci_hcd_ppc_of_probe Miaoqian Lin
2022-06-02 14:10 ` Alan Stern
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.