Skip to content
/ linux Public

Commit 76096f1

Browse files
jhovoldSasha Levin
authored andcommitted
mux: mmio: fix regmap leak on probe failure
[ Upstream commit 3c4ae63 ] 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: 61de83f ("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> Link: https://patch.msgid.link/20251127134702.1915-1-johan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent e401028 commit 76096f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mux/mmio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static int mux_mmio_probe(struct platform_device *pdev)
5858
if (IS_ERR(base))
5959
regmap = ERR_PTR(-ENODEV);
6060
else
61-
regmap = regmap_init_mmio(dev, base, &mux_mmio_regmap_cfg);
61+
regmap = devm_regmap_init_mmio(dev, base, &mux_mmio_regmap_cfg);
6262
/* Fallback to checking the parent node on "real" errors. */
6363
if (IS_ERR(regmap) && regmap != ERR_PTR(-EPROBE_DEFER)) {
6464
regmap = dev_get_regmap(dev->parent, NULL);

0 commit comments

Comments
 (0)