From: Viresh Kumar <viresh.kumar@linaro.org>
To: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Thierry Reding <thierry.reding@gmail.com>,
Jonathan Hunter <jonathanh@nvidia.com>,
Julia Lawall <julia.lawall@inria.fr>,
linux-pm@vger.kernel.org, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH next] cpupfreq: tegra124: eliminate uses of of_node_put()
Date: Fri, 19 Apr 2024 11:58:42 +0530 [thread overview]
Message-ID: <20240419062842.dc6tzssbcqdtdfi5@vireshk-i7> (raw)
In-Reply-To: <20240407-cpufreq_of_node_put-v1-1-2c8889d4935d@gmail.com>
On 07-04-24, 22:15, Javier Carrasco wrote:
> Make use of the __free() cleanup handler to automatically free nodes
> when they get out of scope. Only the probe function is affected by this
> modification.
>
> Given that this mechanism requires the node to be initialized, its
> initialization and the value check have been moved to the top of the
> function.
>
> After removing uses of of_node_put(), the jump to out_put_np is no
> longer necessary.
>
> Suggested-by: Julia Lawall <julia.lawall@inria.fr>
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
> ---
> This patch is a proof of concept to remove uses of of_node_put() in
> cpufreq, which can be replaced with the clenaup handler introduced with
> 54da6a092431 ("locking: Introduce __cleanup() based infrastructure").
>
> This change provides a scope-based cleanup mechanism to avoid potential
> memory leaks that can appear if of_node_put() is not used correctly.
>
> The patch is based on the latest linux-next tag (next-20240405).
> ---
> drivers/cpufreq/tegra124-cpufreq.c | 19 ++++++-------------
> 1 file changed, 6 insertions(+), 13 deletions(-)
Applied. Thanks.
--
viresh
prev parent reply other threads:[~2024-04-19 6:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-07 20:15 [PATCH next] cpupfreq: tegra124: eliminate uses of of_node_put() Javier Carrasco
2024-04-19 6:28 ` Viresh Kumar [this message]
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=20240419062842.dc6tzssbcqdtdfi5@vireshk-i7 \
--to=viresh.kumar@linaro.org \
--cc=javier.carrasco.cruz@gmail.com \
--cc=jonathanh@nvidia.com \
--cc=julia.lawall@inria.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=thierry.reding@gmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).