stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: keystone: syscon-clk: fix regmap leak on probe failure
@ 2025-11-27 13:42 Johan Hovold
  2025-11-30 20:05 ` Stephen Boyd
  0 siblings, 1 reply; 2+ messages in thread
From: Johan Hovold @ 2025-11-27 13:42 UTC (permalink / raw)
  To: Santosh Shilimkar, Stephen Boyd
  Cc: Michael Turquette, Andrew Davis, linux-clk, linux-kernel,
	Johan Hovold, stable

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: stable@vger.kernel.org	# 6.15
Cc: Andrew Davis <afd@ti.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/clk/keystone/syscon-clk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/keystone/syscon-clk.c b/drivers/clk/keystone/syscon-clk.c
index c509929da854..ecf180a7949c 100644
--- a/drivers/clk/keystone/syscon-clk.c
+++ b/drivers/clk/keystone/syscon-clk.c
@@ -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");
-- 
2.51.2


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

* Re: [PATCH] clk: keystone: syscon-clk: fix regmap leak on probe failure
  2025-11-27 13:42 [PATCH] clk: keystone: syscon-clk: fix regmap leak on probe failure Johan Hovold
@ 2025-11-30 20:05 ` Stephen Boyd
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2025-11-30 20:05 UTC (permalink / raw)
  To: Johan Hovold, Santosh Shilimkar
  Cc: Michael Turquette, Andrew Davis, linux-clk, linux-kernel,
	Johan Hovold, stable

Quoting Johan Hovold (2025-11-27 05:42:43)
> 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: stable@vger.kernel.org      # 6.15
> Cc: Andrew Davis <afd@ti.com>
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---

Applied to clk-next

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

end of thread, other threads:[~2025-11-30 20:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-27 13:42 [PATCH] clk: keystone: syscon-clk: fix regmap leak on probe failure Johan Hovold
2025-11-30 20:05 ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).