From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Liang He <windhl@126.com>, Viresh Kumar <viresh.kumar@linaro.org>,
Sasha Levin <sashal@kernel.org>,
rafael@kernel.org, mpe@ellerman.id.au, linux-pm@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org
Subject: [PATCH AUTOSEL 4.19 4/8] cpufreq: pmac32-cpufreq: Fix refcount leak bug
Date: Wed, 6 Jul 2022 11:33:31 -0400 [thread overview]
Message-ID: <20220706153335.1598699-4-sashal@kernel.org> (raw)
In-Reply-To: <20220706153335.1598699-1-sashal@kernel.org>
From: Liang He <windhl@126.com>
[ Upstream commit ccd7567d4b6cf187fdfa55f003a9e461ee629e36 ]
In pmac_cpufreq_init_MacRISC3(), we need to add corresponding
of_node_put() for the three node pointers whose refcount have
been incremented by of_find_node_by_name().
Signed-off-by: Liang He <windhl@126.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cpufreq/pmac32-cpufreq.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/cpufreq/pmac32-cpufreq.c b/drivers/cpufreq/pmac32-cpufreq.c
index e225edb5c359..ce0dda1a4241 100644
--- a/drivers/cpufreq/pmac32-cpufreq.c
+++ b/drivers/cpufreq/pmac32-cpufreq.c
@@ -474,6 +474,10 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
if (slew_done_gpio_np)
slew_done_gpio = read_gpio(slew_done_gpio_np);
+ of_node_put(volt_gpio_np);
+ of_node_put(freq_gpio_np);
+ of_node_put(slew_done_gpio_np);
+
/* If we use the frequency GPIOs, calculate the min/max speeds based
* on the bus frequencies
*/
--
2.35.1
next prev parent reply other threads:[~2022-07-06 15:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-06 15:33 [PATCH AUTOSEL 4.19 1/8] virtio_mmio: Add missing PM calls to freeze/restore Sasha Levin
2022-07-06 15:33 ` [PATCH AUTOSEL 4.19 2/8] virtio_mmio: Restore guest page size on resume Sasha Levin
2022-07-06 15:33 ` [PATCH AUTOSEL 4.19 3/8] netfilter: br_netfilter: do not skip all hooks with 0 priority Sasha Levin
2022-07-06 15:33 ` Sasha Levin [this message]
2022-07-06 15:33 ` [PATCH AUTOSEL 4.19 5/8] platform/x86: hp-wmi: Ignore Sanitization Mode event Sasha Levin
2022-07-06 15:33 ` [PATCH AUTOSEL 4.19 6/8] net: tipc: fix possible refcount leak in tipc_sk_create() Sasha Levin
2022-07-06 15:33 ` [PATCH AUTOSEL 4.19 7/8] NFC: nxp-nci: don't print header length mismatch on i2c error Sasha Levin
2022-07-06 15:33 ` [PATCH AUTOSEL 4.19 8/8] net: sfp: fix memory leak in sfp_probe() Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220706153335.1598699-4-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=rafael@kernel.org \
--cc=stable@vger.kernel.org \
--cc=viresh.kumar@linaro.org \
--cc=windhl@126.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox