Skip to content

Commit 16f2a21

Browse files
krzkgregkh
authored andcommitted
usb: dwc3: xilinx: add missing depopulate in probe error path
Depopulate device in probe error paths to fix leak of children resources. Fixes: 53b5ff8 ("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>
1 parent 2aa765a commit 16f2a21

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

drivers/usb/dwc3/dwc3-xilinx.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,14 @@ static int dwc3_xlnx_probe(struct platform_device *pdev)
327327
goto err_pm_set_suspended;
328328

329329
pm_suspend_ignore_children(dev, false);
330-
return pm_runtime_resume_and_get(dev);
330+
ret = pm_runtime_resume_and_get(dev);
331+
if (ret < 0)
332+
goto err_pm_set_suspended;
333+
334+
return 0;
331335

332336
err_pm_set_suspended:
337+
of_platform_depopulate(dev);
333338
pm_runtime_set_suspended(dev);
334339

335340
err_clk_put:

0 commit comments

Comments
 (0)