Skip to contentSkip to conversation

clk: keystone: syscon-clk: fix regmap leak on probe failure

PATCH Applied Johan Hovold 2 participants 2 messages Nov 27, 2025 – Nov 30, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: keystone: syscon-clk: fix regmap leak on probe failure

The mmio regmap allocated during probe is never freed.

Switch to using the device managed allocator so that the regmap is released on probe failures (e.g. probe deferral) and on driver unbind.

Fixes a250cd4c1901 ("clk: keystone: syscon-clk: Do not use syscon helper to build regmap")
Cc Andrew Davis <[email protected]>
---
 drivers/clk/keystone/syscon-clk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/keystone/syscon-clk.c +1 -1
index c509929da854..ecf180a7949c 100644
@@ -129,7 +129,7 @@ static int ti_syscon_gate_clk_probe(struct platform_device *pdev)
 	if (IS_ERR(base))
 		return PTR_ERR(base);
 
-	regmap = regmap_init_mmio(dev, base, &ti_syscon_regmap_cfg);
+	regmap = devm_regmap_init_mmio(dev, base, &ti_syscon_regmap_cfg);
 	if (IS_ERR(regmap))
 		return dev_err_probe(dev, PTR_ERR(regmap),
 				     "failed to get regmap\n");
Signature · 1 line
2.51.2
maintainer Applied
#1 lore raw

Quoting Johan Hovold (2025-11-27 05:42:43)

Quoted 10 lines

The mmio regmap allocated during probe is never freed.

Switch to using the device managed allocator so that the regmap is released on probe failures (e.g. probe deferral) and on driver unbind.

Fixes a250cd4c1901 ("clk: keystone: syscon-clk: Do not use syscon helper to build regmap")
Cc Andrew Davis <[email protected]>

---

Applied to clk-next