diff options
author | Miaoqian Lin <linmq006@gmail.com> | 2022-06-05 11:28:07 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-08-21 16:15:34 +0300 |
commit | 22e6d8bcde8e66b64f46bf9bd2d3d0f88d40c39f (patch) | |
tree | 9a1a45d51c2ea99fd171e6e6bd237ae1967541ea /arch/arm/mach-zynq | |
parent | d294d60dc68550fee0fbbe8a638d798dcd40b2c5 (diff) | |
download | linux-22e6d8bcde8e66b64f46bf9bd2d3d0f88d40c39f.tar.xz |
cpufreq: zynq: Fix refcount leak in zynq_get_revision
[ Upstream commit d1ff2559cef0f6f8d97fba6337b28adb10689e16 ]
of_find_compatible_node() returns a node pointer with refcount
incremented, we should use of_node_put() on it when done.
Add missing of_node_put() to avoid refcount leak.
Fixes: 00f7dc636366 ("ARM: zynq: Add support for SOC_BUS")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220605082807.21526-1-linmq006@gmail.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch/arm/mach-zynq')
-rw-r--r-- | arch/arm/mach-zynq/common.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c index e1ca6a5732d2..15e8a321a713 100644 --- a/arch/arm/mach-zynq/common.c +++ b/arch/arm/mach-zynq/common.c @@ -77,6 +77,7 @@ static int __init zynq_get_revision(void) } zynq_devcfg_base = of_iomap(np, 0); + of_node_put(np); if (!zynq_devcfg_base) { pr_err("%s: Unable to map I/O memory\n", __func__); return -1; |