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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>

commit 16f2a21d9d7e48e1af02654fe3d926c0ce6cb3e5 upstream.

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@xxxxxxxxxxxxxxx
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xxxxxxx>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>
Acked-by: Thinh Nguyen <Thinh.Nguyen@xxxxxxxxxxxx>
Link: https://lore.kernel.org/r/20240816075409.23080-2-krzysztof.kozlowski@xxxxxxxxxx
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/usb/dwc3/dwc3-xilinx.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- a/drivers/usb/dwc3/dwc3-xilinx.c
+++ b/drivers/usb/dwc3/dwc3-xilinx.c
@@ -298,9 +298,14 @@ static int dwc3_xlnx_probe(struct platfo
 		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:


Patches currently in stable-queue which might be from krzysztof.kozlowski@xxxxxxxxxx are

queue-6.10/usb-dwc3-st-fix-probed-platform-device-ref-count-on-probe-error-path.patch
queue-6.10/nfc-pn533-add-poll-mod-list-filling-check.patch
queue-6.10/usb-dwc3-st-add-missing-depopulate-in-probe-error-path.patch
queue-6.10/soundwire-stream-fix-programming-slave-ports-for-non-continous-port-maps.patch
queue-6.10/usb-dwc3-omap-add-missing-depopulate-in-probe-error-path.patch
queue-6.10/usb-dwc3-xilinx-add-missing-depopulate-in-probe-error-path.patch
queue-6.10/dt-bindings-usb-microchip-usb2514-fix-reference-usb-device-schema.patch




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux