All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] soc: ti: k3-socinfo: fix regmap leak on probe failure
@ 2025-11-27 13:49 Johan Hovold
  2025-12-01 18:02 ` Andrew Davis
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Johan Hovold @ 2025-11-27 13:49 UTC (permalink / raw)
  To: Nishanth Menon, Santosh Shilimkar
  Cc: linux-kernel, Johan Hovold, stable, Andrew Davis

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: a5caf03188e4 ("soc: ti: k3-socinfo: 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/soc/ti/k3-socinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/ti/k3-socinfo.c b/drivers/soc/ti/k3-socinfo.c
index 50c170a995f9..42275cb5ba1c 100644
--- a/drivers/soc/ti/k3-socinfo.c
+++ b/drivers/soc/ti/k3-socinfo.c
@@ -141,7 +141,7 @@ static int k3_chipinfo_probe(struct platform_device *pdev)
 	if (IS_ERR(base))
 		return PTR_ERR(base);
 
-	regmap = regmap_init_mmio(dev, base, &k3_chipinfo_regmap_cfg);
+	regmap = devm_regmap_init_mmio(dev, base, &k3_chipinfo_regmap_cfg);
 	if (IS_ERR(regmap))
 		return PTR_ERR(regmap);
 
-- 
2.51.2


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

* Re: [PATCH] soc: ti: k3-socinfo: fix regmap leak on probe failure
  2025-11-27 13:49 [PATCH] soc: ti: k3-socinfo: fix regmap leak on probe failure Johan Hovold
@ 2025-12-01 18:02 ` Andrew Davis
  2026-01-14 11:04 ` Johan Hovold
  2026-01-14 17:10 ` Nishanth Menon
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Davis @ 2025-12-01 18:02 UTC (permalink / raw)
  To: Johan Hovold, Nishanth Menon, Santosh Shilimkar; +Cc: linux-kernel, stable

On 11/27/25 7:49 AM, Johan Hovold wrote:
> 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: a5caf03188e4 ("soc: ti: k3-socinfo: 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>
> ---

Acked-by: Andrew Davis <afd@ti.com>

>   drivers/soc/ti/k3-socinfo.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/soc/ti/k3-socinfo.c b/drivers/soc/ti/k3-socinfo.c
> index 50c170a995f9..42275cb5ba1c 100644
> --- a/drivers/soc/ti/k3-socinfo.c
> +++ b/drivers/soc/ti/k3-socinfo.c
> @@ -141,7 +141,7 @@ static int k3_chipinfo_probe(struct platform_device *pdev)
>   	if (IS_ERR(base))
>   		return PTR_ERR(base);
>   
> -	regmap = regmap_init_mmio(dev, base, &k3_chipinfo_regmap_cfg);
> +	regmap = devm_regmap_init_mmio(dev, base, &k3_chipinfo_regmap_cfg);
>   	if (IS_ERR(regmap))
>   		return PTR_ERR(regmap);
>   


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

* Re: [PATCH] soc: ti: k3-socinfo: fix regmap leak on probe failure
  2025-11-27 13:49 [PATCH] soc: ti: k3-socinfo: fix regmap leak on probe failure Johan Hovold
  2025-12-01 18:02 ` Andrew Davis
@ 2026-01-14 11:04 ` Johan Hovold
  2026-01-14 17:10 ` Nishanth Menon
  2 siblings, 0 replies; 4+ messages in thread
From: Johan Hovold @ 2026-01-14 11:04 UTC (permalink / raw)
  To: Nishanth Menon, Santosh Shilimkar; +Cc: linux-kernel, stable, Andrew Davis

On Thu, Nov 27, 2025 at 02:49:42PM +0100, Johan Hovold wrote:
> 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: a5caf03188e4 ("soc: ti: k3-socinfo: 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>

Can this one be picked up now?

Johan

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

* Re: [PATCH] soc: ti: k3-socinfo: fix regmap leak on probe failure
  2025-11-27 13:49 [PATCH] soc: ti: k3-socinfo: fix regmap leak on probe failure Johan Hovold
  2025-12-01 18:02 ` Andrew Davis
  2026-01-14 11:04 ` Johan Hovold
@ 2026-01-14 17:10 ` Nishanth Menon
  2 siblings, 0 replies; 4+ messages in thread
From: Nishanth Menon @ 2026-01-14 17:10 UTC (permalink / raw)
  To: Santosh Shilimkar, Johan Hovold
  Cc: Nishanth Menon, linux-kernel, stable, Andrew Davis

Hi Johan Hovold,

On Thu, 27 Nov 2025 14:49:42 +0100, Johan Hovold wrote:
> 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.
> 
> 

I have applied the following to branch ti-drivers-soc-next on [1].
Apologies on missing this in my filter and thanks for following up.
Thank you!

[1/1] soc: ti: k3-socinfo: fix regmap leak on probe failure
      commit: c933138d45176780fabbbe7da263e04d5b3e525d

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent up the chain during
the next merge window (or sooner if it is a relevant bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git
-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
https://ti.com/opensource


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

end of thread, other threads:[~2026-01-14 17:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-27 13:49 [PATCH] soc: ti: k3-socinfo: fix regmap leak on probe failure Johan Hovold
2025-12-01 18:02 ` Andrew Davis
2026-01-14 11:04 ` Johan Hovold
2026-01-14 17:10 ` Nishanth Menon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.