mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
mux: mmio: fix regmap leak on probe failure
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: 61de83fd82 ("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
8f96d37e88
commit
3c4ae63073
@@ -72,7 +72,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);
|
||||
|
||||
Reference in New Issue
Block a user