mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
amba: bus: fix refcount leak
[ Upstream commite312cbdc11
] commit5de1540b7b
("drivers/amba: create devices from device tree") increases the refcount of of_node, but not releases it in amba_device_release, so there is refcount leak. By using of_node_put to avoid refcount leak. Fixes:5de1540b7b
("drivers/amba: create devices from device tree") Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230821023928.3324283-1-peng.fan@oss.nxp.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
db18d5e3ee
commit
81ff633a88
@ -534,6 +534,7 @@ static void amba_device_release(struct device *dev)
|
||||
{
|
||||
struct amba_device *d = to_amba_device(dev);
|
||||
|
||||
of_node_put(d->dev.of_node);
|
||||
if (d->res.parent)
|
||||
release_resource(&d->res);
|
||||
mutex_destroy(&d->periphid_lock);
|
||||
|
Loading…
Reference in New Issue
Block a user