* [PATCH v2 1/2] usb: dwc3: omap: add missing depopulate in probe error path
@ 2024-08-16 7:54 Krzysztof Kozlowski
2024-08-16 7:54 ` [PATCH v2 2/2] usb: dwc3: xilinx: " Krzysztof Kozlowski
0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Kozlowski @ 2024-08-16 7:54 UTC (permalink / raw)
To: Thinh Nguyen, Greg Kroah-Hartman, Michal Simek, Vignesh R,
Felipe Balbi, Grygorii Strashko, Piyush Mehta,
Radhey Shyam Pandey, linux-usb, linux-omap, linux-kernel,
linux-arm-kernel
Cc: Krzysztof Kozlowski, stable
Depopulate device in probe error paths to fix leak of children
resources.
Fixes: ee249b455494 ("usb: dwc3: omap: remove IRQ_NOAUTOEN used with shared irq")
Cc: stable@vger.kernel.org
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
Changes in v2:
1. Add Ack
---
drivers/usb/dwc3/dwc3-omap.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index d5c77db4daa9..2a11fc0ee84f 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -522,11 +522,13 @@ static int dwc3_omap_probe(struct platform_device *pdev)
if (ret) {
dev_err(dev, "failed to request IRQ #%d --> %d\n",
omap->irq, ret);
- goto err1;
+ goto err2;
}
dwc3_omap_enable_irqs(omap);
return 0;
+err2:
+ of_platform_depopulate(dev);
err1:
pm_runtime_put_sync(dev);
pm_runtime_disable(dev);
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2 2/2] usb: dwc3: xilinx: add missing depopulate in probe error path
2024-08-16 7:54 [PATCH v2 1/2] usb: dwc3: omap: add missing depopulate in probe error path Krzysztof Kozlowski
@ 2024-08-16 7:54 ` Krzysztof Kozlowski
2024-08-16 22:32 ` Thinh Nguyen
0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Kozlowski @ 2024-08-16 7:54 UTC (permalink / raw)
To: Thinh Nguyen, Greg Kroah-Hartman, Michal Simek, Vignesh R,
Felipe Balbi, Grygorii Strashko, Piyush Mehta,
Radhey Shyam Pandey, linux-usb, linux-omap, linux-kernel,
linux-arm-kernel
Cc: Krzysztof Kozlowski, stable
Depopulate device in probe error paths to fix leak of children
resources.
Fixes: 53b5ff83d893 ("usb: dwc3: xilinx: improve error handling for PM APIs")
Cc: stable@vger.kernel.org
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
Changes in v2:
1. Add goto also on pm_runtime_resume_and_get() failure (Thinh)
2. Add Rb tag.
---
drivers/usb/dwc3/dwc3-xilinx.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/dwc3/dwc3-xilinx.c b/drivers/usb/dwc3/dwc3-xilinx.c
index bb4d894c16e9..f1298b1b4f84 100644
--- a/drivers/usb/dwc3/dwc3-xilinx.c
+++ b/drivers/usb/dwc3/dwc3-xilinx.c
@@ -327,9 +327,14 @@ static int dwc3_xlnx_probe(struct platform_device *pdev)
goto err_pm_set_suspended;
pm_suspend_ignore_children(dev, false);
- return pm_runtime_resume_and_get(dev);
+ ret = pm_runtime_resume_and_get(dev);
+ if (ret < 0)
+ goto err_pm_set_suspended;
+
+ return 0;
err_pm_set_suspended:
+ of_platform_depopulate(dev);
pm_runtime_set_suspended(dev);
err_clk_put:
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2 2/2] usb: dwc3: xilinx: add missing depopulate in probe error path
2024-08-16 7:54 ` [PATCH v2 2/2] usb: dwc3: xilinx: " Krzysztof Kozlowski
@ 2024-08-16 22:32 ` Thinh Nguyen
0 siblings, 0 replies; 3+ messages in thread
From: Thinh Nguyen @ 2024-08-16 22:32 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Thinh Nguyen, Greg Kroah-Hartman, Michal Simek, Vignesh R,
Felipe Balbi, Grygorii Strashko, Piyush Mehta,
Radhey Shyam Pandey, linux-usb, linux-omap, linux-kernel,
linux-arm-kernel, stable
On Fri, Aug 16, 2024, Krzysztof Kozlowski wrote:
> Depopulate device in probe error paths to fix leak of children
> resources.
>
> Fixes: 53b5ff83d893 ("usb: dwc3: xilinx: improve error handling for PM APIs")
> Cc: stable@vger.kernel.org
> Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>
> ---
>
> Changes in v2:
> 1. Add goto also on pm_runtime_resume_and_get() failure (Thinh)
> 2. Add Rb tag.
> ---
> drivers/usb/dwc3/dwc3-xilinx.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/dwc3/dwc3-xilinx.c b/drivers/usb/dwc3/dwc3-xilinx.c
> index bb4d894c16e9..f1298b1b4f84 100644
> --- a/drivers/usb/dwc3/dwc3-xilinx.c
> +++ b/drivers/usb/dwc3/dwc3-xilinx.c
> @@ -327,9 +327,14 @@ static int dwc3_xlnx_probe(struct platform_device *pdev)
> goto err_pm_set_suspended;
>
> pm_suspend_ignore_children(dev, false);
> - return pm_runtime_resume_and_get(dev);
> + ret = pm_runtime_resume_and_get(dev);
> + if (ret < 0)
> + goto err_pm_set_suspended;
> +
> + return 0;
>
> err_pm_set_suspended:
> + of_platform_depopulate(dev);
> pm_runtime_set_suspended(dev);
>
> err_clk_put:
> --
> 2.43.0
>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Thanks,
Thinh
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-08-16 22:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-16 7:54 [PATCH v2 1/2] usb: dwc3: omap: add missing depopulate in probe error path Krzysztof Kozlowski
2024-08-16 7:54 ` [PATCH v2 2/2] usb: dwc3: xilinx: " Krzysztof Kozlowski
2024-08-16 22:32 ` Thinh Nguyen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®