Skip to contentSkip to conversation

memory: tegra186-emc: Fix missing put_bpmp

PATCH Applied Jon Hunter 2 participants 2 messages Nov 6, 2025 – Nov 7, 2025

Subsystems (2)
lore
Share & tools
lore

Jon Hunter

author maintainer
#0 lore raw

PATCH v3 1/1 memory: tegra186-emc: Fix missing put_bpmp

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()")

---
Changes since V2:
- Eliminated extra line for initialising 'err' variable. Changes since V1:
- Fixed dev_err_probe message format

Please note that the commit hash reference is based upon the hash in the -next tree.

 drivers/memory/tegra/tegra186-emc.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/memory/tegra/tegra186-emc.c +5 -3
index 74be09968baa..b73daf5326cc 100644
@@ -448,9 +448,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;
Signature · 1 line
2.43.0
#1 lore raw
Quoted 6 lines · Jon Hunter

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.

Applied, thanks!

[1/1] memory: tegra186-emc: Fix missing put_bpmp

      https://git.kernel.org/krzk/linux-mem-ctrl/c/8728bdd648f1b0f48ddfdb57bf6d9e7515e02518

Best regards,

Signature · 1 line
Krzysztof Kozlowski <[email protected]>