summaryrefslogtreecommitdiffstats
path: root/drivers/amba
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2023-08-21 10:39:27 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-09-23 10:48:09 +0200
commit9062ce0ccbd82fbe81cc839a512c0ad90847e01c (patch)
tree23de0e8c17807e7a17c16b0c8ad684094012e29a /drivers/amba
parente20a982f1517f29a388d908f92e79d3d39a4ce42 (diff)
downloadlinux-stable-9062ce0ccbd82fbe81cc839a512c0ad90847e01c.tar.gz
linux-stable-9062ce0ccbd82fbe81cc839a512c0ad90847e01c.tar.bz2
linux-stable-9062ce0ccbd82fbe81cc839a512c0ad90847e01c.zip
amba: bus: fix refcount leak
[ Upstream commit e312cbdc11305568554a9e18a2ea5c2492c183f3 ] commit 5de1540b7bc4 ("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: 5de1540b7bc4 ("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>
Diffstat (limited to 'drivers/amba')
-rw-r--r--drivers/amba/bus.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index e1992f361c9a..2aaec96f8384 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -349,6 +349,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);
kfree(d);