mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] dwc3: google: Fix PM domain leak in dwc3_google_probe()
@ 2026-03-16 15:30 Felix Gu
  2026-03-18  1:14 ` Thinh Nguyen
  0 siblings, 1 reply; 2+ messages in thread
From: Felix Gu @ 2026-03-16 15:30 UTC (permalink / raw)
  To: Peter Griffin, André Draszik, Tudor Ambarus, Thinh Nguyen,
	Greg Kroah-Hartman, Joy Chakraborty, Roy Luo, Naveen Kumar
  Cc: linux-arm-kernel, linux-samsung-soc, linux-usb, linux-kernel, Felix Gu

When syscon_regmap_lookup_by_phandle_args() fails, the function was
returning directly without cleaning up the power domain initialized
earlier by dwc3_google_pm_domain_init().

Fix by jumping to err_deinit_pdom to properly clean up resources.

Fixes: 8995a37371bf4 ("usb: dwc3: Add Google Tensor SoC DWC3 glue driver")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
---
 drivers/usb/dwc3/dwc3-google.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-google.c b/drivers/usb/dwc3/dwc3-google.c
index 2105c72af753..4ca567ec01d0 100644
--- a/drivers/usb/dwc3/dwc3-google.c
+++ b/drivers/usb/dwc3/dwc3-google.c
@@ -385,8 +385,9 @@ static int dwc3_google_probe(struct platform_device *pdev)
 						     "google,usb-cfg-csr",
 						     ARRAY_SIZE(args), args);
 	if (IS_ERR(google->usb_cfg_regmap)) {
-		return dev_err_probe(dev, PTR_ERR(google->usb_cfg_regmap),
-				     "invalid usb cfg csr\n");
+		ret = dev_err_probe(dev, PTR_ERR(google->usb_cfg_regmap),
+				    "invalid usb cfg csr\n");
+		goto err_deinit_pdom;
 	}
 
 	google->host_cfg_offset = args[0];

---
base-commit: b84a0ebe421ca56995ff78b66307667b62b3a900
change-id: 20260316-dwc3-google-fd617b3d19f5

Best regards,
-- 
Felix Gu <ustc.gu@gmail.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] dwc3: google: Fix PM domain leak in dwc3_google_probe()
  2026-03-16 15:30 [PATCH] dwc3: google: Fix PM domain leak in dwc3_google_probe() Felix Gu
@ 2026-03-18  1:14 ` Thinh Nguyen
  0 siblings, 0 replies; 2+ messages in thread
From: Thinh Nguyen @ 2026-03-18  1:14 UTC (permalink / raw)
  To: Felix Gu
  Cc: Peter Griffin, André Draszik, Tudor Ambarus, Thinh Nguyen,
	Greg Kroah-Hartman, Joy Chakraborty, Roy Luo, Naveen Kumar,
	linux-arm-kernel, linux-samsung-soc, linux-usb, linux-kernel

On Mon, Mar 16, 2026, Felix Gu wrote:
> When syscon_regmap_lookup_by_phandle_args() fails, the function was
> returning directly without cleaning up the power domain initialized
> earlier by dwc3_google_pm_domain_init().
> 
> Fix by jumping to err_deinit_pdom to properly clean up resources.
> 
> Fixes: 8995a37371bf4 ("usb: dwc3: Add Google Tensor SoC DWC3 glue driver")
> Signed-off-by: Felix Gu <ustc.gu@gmail.com>
> ---
>  drivers/usb/dwc3/dwc3-google.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-google.c b/drivers/usb/dwc3/dwc3-google.c
> index 2105c72af753..4ca567ec01d0 100644
> --- a/drivers/usb/dwc3/dwc3-google.c
> +++ b/drivers/usb/dwc3/dwc3-google.c
> @@ -385,8 +385,9 @@ static int dwc3_google_probe(struct platform_device *pdev)
>  						     "google,usb-cfg-csr",
>  						     ARRAY_SIZE(args), args);
>  	if (IS_ERR(google->usb_cfg_regmap)) {
> -		return dev_err_probe(dev, PTR_ERR(google->usb_cfg_regmap),
> -				     "invalid usb cfg csr\n");
> +		ret = dev_err_probe(dev, PTR_ERR(google->usb_cfg_regmap),
> +				    "invalid usb cfg csr\n");
> +		goto err_deinit_pdom;
>  	}
>  
>  	google->host_cfg_offset = args[0];
> 
> ---
> base-commit: b84a0ebe421ca56995ff78b66307667b62b3a900
> change-id: 20260316-dwc3-google-fd617b3d19f5
> 
> Best regards,
> -- 
> Felix Gu <ustc.gu@gmail.com>
> 

Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>

BR,
Thinh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-03-18  1:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-16 15:30 [PATCH] dwc3: google: Fix PM domain leak in dwc3_google_probe() Felix Gu
2026-03-18  1:14 ` 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®