Skip to contentSkip to conversation

mfd: altera-sysmgr: fix device leak on sysmgr regmap lookup

PATCH Applied Johan Hovold 3 participants 3 messages Sep 25, 2025 – Oct 9, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mfd: altera-sysmgr: fix device leak on sysmgr regmap lookup

Make sure to drop the reference taken to the sysmgr platform device when retrieving its driver data.

Note that holding a reference to a device does not prevent its driver data from going away.

Fixes f36e789a1f8d ("mfd: altera-sysmgr: Add SOCFPGA System Manager")
---
 drivers/mfd/altera-sysmgr.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mfd/altera-sysmgr.c +2 -0
index fb5f988e61f3..90c6902d537d 100644
@@ -117,6 +117,8 @@ struct regmap *altr_sysmgr_regmap_lookup_by_phandle(struct device_node *np,
 
 	sysmgr = dev_get_drvdata(dev);
 
+	put_device(dev);
+
 	return sysmgr->regmap;
 }
 EXPORT_SYMBOL_GPL(altr_sysmgr_regmap_lookup_by_phandle);
Signature · 1 line
2.49.1
maintainer Applied
#2 lore raw

Re: (subset) [PATCH] mfd: altera-sysmgr: fix device leak on sysmgr regmap lookup

In reply to Johan Hovold
Quoted 8 lines · Johan Hovold

Make sure to drop the reference taken to the sysmgr platform device when retrieving its driver data.

Note that holding a reference to a device does not prevent its driver data from going away.

[...]

Applied, thanks!

[1/1] mfd: altera-sysmgr: fix device leak on sysmgr regmap lookup

      commit: e6ce75fac4a299805939e33f9f104829ba9ffdcc

--
Lee Jones [李琼斯]