From: Lukasz Luba <lukasz.luba@arm.com>
To: zhaofeng2@cmss.chinamobile.com
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
Daniel Lezcano <daniel.lezcano@linaro.org>
Subject: Re: [PATCH] thermal: thermal_of: fix OF node leak in thermal_of_for_each_cooling_device()
Date: Fri, 27 Nov 2026 07:57:30 +0000 [thread overview]
Message-ID: <5bb03d26-f912-4c15-80c2-c070c40cafd0@arm.com> (raw)
In-Reply-To: <20261127074225.1798-1-zhaofeng2@cmss.chinamobile.com>
On 11/27/26 07:42, zhaofeng2@cmss.chinamobile.com wrote:
> From: Zhao Feng <zhaofeng2@cmss.chinamobile.com>
>
> thermal_of_for_each_cooling_device() calls of_parse_phandle()
> to obtain tr_np, uses it only to call of_find_trip_id(), and
> then leaks it on every subsequent return path.
>
> Drop the reference with of_node_put() once the node is no
> longer needed.
>
> Signed-off-by: Zhao Feng <zhaofeng2@cmss.chinamobile.com>
> ---
> Verified against current tree. Leak found by code inspection
> (OF reference-counting audit of thermal_of_for_each_cooling_device()).
This function doesn't exist anymore. I has been removed with
94c6110b0b13c64161
>
> thermal/thermal_of.c | 1 +-++
> 1 file changed, 1 insertion(+), 0 deletion(-)
>
> --- a/drivers/thermal/thermal_of.c
> +++ b/drivers/thermal/thermal_of.c
> @@ -365,6 +365,7 @@
> return -ENODEV;
>
> trip_id = of_find_trip_id(tz_np, tr_np);
> + of_node_put(tr_np);
> if (trip_id < 0)
> return trip_id;
>
>
>
>
It's not a valid patch.
prev parent reply other threads:[~2026-11-27 7:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 7:42 zhaofeng2
2026-11-27 7:57 ` Lukasz Luba [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=5bb03d26-f912-4c15-80c2-c070c40cafd0@arm.com \
--to=lukasz.luba@arm.com \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=zhaofeng2@cmss.chinamobile.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
all inboxes | Powered by JetHome®