]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
memory: tegra186-emc: Fix missing put_bpmp
authorJon Hunter <jonathanh@nvidia.com>
Thu, 6 Nov 2025 19:05:50 +0000 (19:05 +0000)
committerKrzysztof Kozlowski <krzk@kernel.org>
Sat, 22 Nov 2025 12:41:24 +0000 (13:41 +0100)
Commit a52ddb98a674 ("memory: tegra186-emc: Simplify and handle deferred
probe with dev_err_probe()") accidently dropped a call to 'put_bpmp' to
release a handle to the BPMP when getting the EMC clock fails. Fix this
by restoring the 'goto put_bpmp' if devm_clk_get() fails.

Fixes: a52ddb98a674 ("memory: tegra186-emc: Simplify and handle deferred probe with dev_err_probe()")
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://patch.msgid.link/20251106190550.1776974-1-jonathanh@nvidia.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
drivers/memory/tegra/tegra186-emc.c

index 9959ad5804b444b269456d1fbae87b4bc111661b..dfddceecdd1aae9feaa3a9ca0d54b9249536e6fe 100644 (file)
@@ -322,9 +322,11 @@ static int tegra186_emc_probe(struct platform_device *pdev)
                                     "failed to get BPMP\n");
 
        emc->clk = devm_clk_get(&pdev->dev, "emc");
-       if (IS_ERR(emc->clk))
-               return dev_err_probe(&pdev->dev, PTR_ERR(emc->clk),
-                                    "failed to get EMC clock\n");
+       if (IS_ERR(emc->clk)) {
+               err = dev_err_probe(&pdev->dev, PTR_ERR(emc->clk),
+                                   "failed to get EMC clock\n");
+               goto put_bpmp;
+       }
 
        platform_set_drvdata(pdev, emc);
        emc->dev = &pdev->dev;