diff options
author | Miaoqian Lin <linmq006@gmail.com> | 2022-05-16 10:20:10 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-06-14 19:32:33 +0300 |
commit | 5b3e990f85eb034faa461e691e719e8ce9e2a3c8 (patch) | |
tree | 2eb103f5fde85c9a13df0b6a9fe13091bdd428ff /drivers/soc | |
parent | cfe8a0967d6ea6dbc133da7df4a50ad7b4b5c60b (diff) | |
download | linux-5b3e990f85eb034faa461e691e719e8ce9e2a3c8.tar.xz |
soc: rockchip: Fix refcount leak in rockchip_grf_init
[ Upstream commit 9b59588d8be91c96bfb0371e912ceb4f16315dbf ]
of_find_matching_node_and_match 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: 4c58063d4258 ("soc: rockchip: add driver handling grf setup")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220516072013.19731-1-linmq006@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/soc')
-rw-r--r-- | drivers/soc/rockchip/grf.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/soc/rockchip/grf.c b/drivers/soc/rockchip/grf.c index 494cf2b5bf7b..343ff61ccccb 100644 --- a/drivers/soc/rockchip/grf.c +++ b/drivers/soc/rockchip/grf.c @@ -148,12 +148,14 @@ static int __init rockchip_grf_init(void) return -ENODEV; if (!match || !match->data) { pr_err("%s: missing grf data\n", __func__); + of_node_put(np); return -EINVAL; } grf_info = match->data; grf = syscon_node_to_regmap(np); + of_node_put(np); if (IS_ERR(grf)) { pr_err("%s: could not get grf syscon\n", __func__); return PTR_ERR(grf); |