mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.19 1/8] ARM: rockchip: Add missing of_node_put() in rockchip_suspend_init()
@ 2022-07-20  1:18 Sasha Levin
  2022-07-20  1:18 ` [PATCH AUTOSEL 4.19 2/8] x86/bugs: Keep a per-CPU IA32_SPEC_CTRL value Sasha Levin
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Sasha Levin @ 2022-07-20  1:18 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Liang He, Heiko Stuebner, Sasha Levin, linux, linux-arm-kernel,
	linux-rockchip

From: Liang He <windhl@126.com>

[ Upstream commit f4470dbfb5ff92804650bc71d115c3f150d430f6 ]

In rockchip_suspend_init(), of_find_matching_node_and_match() will
return a node pointer with refcount incremented. We should use
of_node_put() in fail path or when it is not used anymore.

Signed-off-by: Liang He <windhl@126.com>
Link: https://lore.kernel.org/r/20220616021713.3973472-1-windhl@126.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm/mach-rockchip/pm.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-rockchip/pm.c b/arch/arm/mach-rockchip/pm.c
index 0592534e0b88..66ea37a846c8 100644
--- a/arch/arm/mach-rockchip/pm.c
+++ b/arch/arm/mach-rockchip/pm.c
@@ -318,7 +318,7 @@ void __init rockchip_suspend_init(void)
 					     &match);
 	if (!match) {
 		pr_err("Failed to find PMU node\n");
-		return;
+		goto out_put;
 	}
 	pm_data = (struct rockchip_pm_data *) match->data;
 
@@ -327,9 +327,12 @@ void __init rockchip_suspend_init(void)
 
 		if (ret) {
 			pr_err("%s: matches init error %d\n", __func__, ret);
-			return;
+			goto out_put;
 		}
 	}
 
 	suspend_set_ops(pm_data->ops);
+
+out_put:
+	of_node_put(np);
 }
-- 
2.35.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-07-20  1:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-20  1:18 [PATCH AUTOSEL 4.19 1/8] ARM: rockchip: Add missing of_node_put() in rockchip_suspend_init() Sasha Levin
2022-07-20  1:18 ` [PATCH AUTOSEL 4.19 2/8] x86/bugs: Keep a per-CPU IA32_SPEC_CTRL value Sasha Levin
2022-07-20  1:18 ` [PATCH AUTOSEL 4.19 3/8] x86/bugs: Optimize SPEC_CTRL MSR writes Sasha Levin
2022-07-20  1:18 ` [PATCH AUTOSEL 4.19 4/8] wifi: cfg80211: Allow P2P client interface to indicate port authorization Sasha Levin
2022-07-20  1:18 ` [PATCH AUTOSEL 4.19 5/8] nilfs2: fix incorrect masking of permission flags for symlinks Sasha Levin
2022-07-20  1:18 ` [PATCH AUTOSEL 4.19 6/8] ASoC: wm8998: Fix event generation for input mux Sasha Levin
2022-07-20  1:18 ` [PATCH AUTOSEL 4.19 7/8] scsi: target: Fix WRITE_SAME No Data Buffer crash Sasha Levin
2022-07-20  1:18 ` [PATCH AUTOSEL 4.19 8/8] platform/x86: asus-wmi: Add key mappings Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®