mirror of
https://github.com/torvalds/linux.git
synced 2026-01-24 23:16:46 +00:00
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: f36e789a1f ("mfd: altera-sysmgr: Add SOCFPGA System Manager")
Cc: stable@vger.kernel.org # 5.2
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Lee Jones <lee@kernel.org>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user