* [PATCH] mux: mmio: fix regmap leak on probe failure
@ 2025-11-27 13:47 Johan Hovold
2025-12-01 18:02 ` Andrew Davis
2026-01-27 15:56 ` Johan Hovold
0 siblings, 2 replies; 5+ messages in thread
From: Johan Hovold @ 2025-11-27 13:47 UTC (permalink / raw)
To: Peter Rosin
Cc: Greg Kroah-Hartman, linux-kernel, Johan Hovold, stable,
Andrew Davis
The mmio regmap that may be 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: 61de83fd8256 ("mux: mmio: Do not use syscon helper to build regmap")
Cc: stable@vger.kernel.org # 6.16
Cc: Andrew Davis <afd@ti.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/mux/mmio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mux/mmio.c b/drivers/mux/mmio.c
index 9993ce38a818..5b0171d19d43 100644
--- a/drivers/mux/mmio.c
+++ b/drivers/mux/mmio.c
@@ -58,7 +58,7 @@ static int mux_mmio_probe(struct platform_device *pdev)
if (IS_ERR(base))
regmap = ERR_PTR(-ENODEV);
else
- regmap = regmap_init_mmio(dev, base, &mux_mmio_regmap_cfg);
+ regmap = devm_regmap_init_mmio(dev, base, &mux_mmio_regmap_cfg);
/* Fallback to checking the parent node on "real" errors. */
if (IS_ERR(regmap) && regmap != ERR_PTR(-EPROBE_DEFER)) {
regmap = dev_get_regmap(dev->parent, NULL);
--
2.51.2
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] mux: mmio: fix regmap leak on probe failure
2025-11-27 13:47 [PATCH] mux: mmio: fix regmap leak on probe failure Johan Hovold
@ 2025-12-01 18:02 ` Andrew Davis
2026-01-27 15:56 ` Johan Hovold
1 sibling, 0 replies; 5+ messages in thread
From: Andrew Davis @ 2025-12-01 18:02 UTC (permalink / raw)
To: Johan Hovold, Peter Rosin; +Cc: Greg Kroah-Hartman, linux-kernel, stable
On 11/27/25 7:47 AM, Johan Hovold wrote:
> The mmio regmap that may be 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: 61de83fd8256 ("mux: mmio: Do not use syscon helper to build regmap")
> Cc: stable@vger.kernel.org # 6.16
> Cc: Andrew Davis <afd@ti.com>
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
Acked-by: Andrew Davis <afd@ti.com>
> drivers/mux/mmio.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mux/mmio.c b/drivers/mux/mmio.c
> index 9993ce38a818..5b0171d19d43 100644
> --- a/drivers/mux/mmio.c
> +++ b/drivers/mux/mmio.c
> @@ -58,7 +58,7 @@ static int mux_mmio_probe(struct platform_device *pdev)
> if (IS_ERR(base))
> regmap = ERR_PTR(-ENODEV);
> else
> - regmap = regmap_init_mmio(dev, base, &mux_mmio_regmap_cfg);
> + regmap = devm_regmap_init_mmio(dev, base, &mux_mmio_regmap_cfg);
> /* Fallback to checking the parent node on "real" errors. */
> if (IS_ERR(regmap) && regmap != ERR_PTR(-EPROBE_DEFER)) {
> regmap = dev_get_regmap(dev->parent, NULL);
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] mux: mmio: fix regmap leak on probe failure
2025-11-27 13:47 [PATCH] mux: mmio: fix regmap leak on probe failure Johan Hovold
2025-12-01 18:02 ` Andrew Davis
@ 2026-01-27 15:56 ` Johan Hovold
2026-02-04 16:18 ` Johan Hovold
1 sibling, 1 reply; 5+ messages in thread
From: Johan Hovold @ 2026-01-27 15:56 UTC (permalink / raw)
To: Peter Rosin; +Cc: Greg Kroah-Hartman, linux-kernel, stable, Andrew Davis
On Thu, Nov 27, 2025 at 02:47:02PM +0100, Johan Hovold wrote:
> The mmio regmap that may be 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: 61de83fd8256 ("mux: mmio: Do not use syscon helper to build regmap")
> Cc: stable@vger.kernel.org # 6.16
> Cc: Andrew Davis <afd@ti.com>
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
Can this one be picked up for 6.20?
Johan
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] mux: mmio: fix regmap leak on probe failure
2026-01-27 15:56 ` Johan Hovold
@ 2026-02-04 16:18 ` Johan Hovold
2026-02-05 16:07 ` Greg Kroah-Hartman
0 siblings, 1 reply; 5+ messages in thread
From: Johan Hovold @ 2026-02-04 16:18 UTC (permalink / raw)
To: Peter Rosin, Greg Kroah-Hartman; +Cc: linux-kernel, stable, Andrew Davis
Hi Greg and Peter,
On Tue, Jan 27, 2026 at 04:56:15PM +0100, Johan Hovold wrote:
> On Thu, Nov 27, 2025 at 02:47:02PM +0100, Johan Hovold wrote:
> > The mmio regmap that may be 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: 61de83fd8256 ("mux: mmio: Do not use syscon helper to build regmap")
> > Cc: stable@vger.kernel.org # 6.16
> > Cc: Andrew Davis <afd@ti.com>
> > Signed-off-by: Johan Hovold <johan@kernel.org>
> > ---
>
> Can this one be picked up for 6.20?
This one has been sitting on the list for over two months now without
any comment from Peter.
I know there have been some issues in the past which patches for this
subsystem not being picked up, so perhaps you could just take this one
directly, Greg?
It's been reviewed by Andrew.
Johan
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] mux: mmio: fix regmap leak on probe failure
2026-02-04 16:18 ` Johan Hovold
@ 2026-02-05 16:07 ` Greg Kroah-Hartman
0 siblings, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-05 16:07 UTC (permalink / raw)
To: Johan Hovold; +Cc: Peter Rosin, linux-kernel, stable, Andrew Davis
On Wed, Feb 04, 2026 at 05:18:00PM +0100, Johan Hovold wrote:
> Hi Greg and Peter,
>
> On Tue, Jan 27, 2026 at 04:56:15PM +0100, Johan Hovold wrote:
> > On Thu, Nov 27, 2025 at 02:47:02PM +0100, Johan Hovold wrote:
> > > The mmio regmap that may be 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: 61de83fd8256 ("mux: mmio: Do not use syscon helper to build regmap")
> > > Cc: stable@vger.kernel.org # 6.16
> > > Cc: Andrew Davis <afd@ti.com>
> > > Signed-off-by: Johan Hovold <johan@kernel.org>
> > > ---
> >
> > Can this one be picked up for 6.20?
>
> This one has been sitting on the list for over two months now without
> any comment from Peter.
>
> I know there have been some issues in the past which patches for this
> subsystem not being picked up, so perhaps you could just take this one
> directly, Greg?
>
> It's been reviewed by Andrew.
>
> Johan
Now taken, thanks.,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-02-05 16:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-27 13:47 [PATCH] mux: mmio: fix regmap leak on probe failure Johan Hovold
2025-12-01 18:02 ` Andrew Davis
2026-01-27 15:56 ` Johan Hovold
2026-02-04 16:18 ` Johan Hovold
2026-02-05 16:07 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox