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: [email protected] Reviewed-by: Radhey Shyam Pandey <[email protected]> Signed-off-by: Krzysztof Kozlowski <[email protected]> Acked-by: Thinh Nguyen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2aa765a commit 16f2a21

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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)