usb: dwc3: xilinx: add missing depopulate in probe error path

commit 16f2a21d9d upstream.

Depopulate device in probe error paths to fix leak of children
resources.

Fixes: 53b5ff83d8 ("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>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/20240816075409.23080-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Krzysztof Kozlowski
2024-08-16 09:54:09 +02:00
committed by Greg Kroah-Hartman
parent 87670ba8d4
commit e49fae2bfd
+6 -1
View File
@@ -298,9 +298,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: