]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
dwc3: google: Fix PM domain leak in dwc3_google_probe()
authorFelix Gu <ustc.gu@gmail.com>
Mon, 16 Mar 2026 15:30:06 +0000 (23:30 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2026 15:18:22 +0000 (16:18 +0100)
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>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://patch.msgid.link/20260316-dwc3-google-v1-1-c9bde1b02f62@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/dwc3-google.c

index 2105c72af7532746116760664afe30506c5e830f..4ca567ec01d07106653a6e25ce687eaf9da5b5e4 100644 (file)
@@ -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];