From: Felix Gu <gu_0233@qq.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Sudeep Holla <sudeep.holla@arm.com>,
Cristian Marussi <cristian.marussi@arm.com>,
arm-scmi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] firmware: arm_scpi: Fix a reference leak on device node
Date: Tue, 20 Jan 2026 01:55:19 +0800 [thread overview]
Message-ID: <tencent_C06105A21611283E4866B846091CE7B3CF06@qq.com> (raw)
In-Reply-To: <aW0xWZ-KylipPF7M@stanley.mountain>
Hi Dan,
Thanks for the review.
I found this issue through code review.
From the comments and implementation, I believe this is a problem.
The caller often misses calling of_node_put(), and I have found a lot of
similar issues in the driver code.
Best regards,
Felix Gu
在 2026/1/19 3:15, Dan Carpenter 写道:
> On Fri, Jan 16, 2026 at 08:54:39PM +0800, Felix Gu wrote:
>> When calling of_parse_phandle_with_args(), the caller is responsible
>> to call of_node_put() to release the reference of device node.
>> In scpi_dev_domain_id, it does not release the reference.
>>
>> Fixes: 45ca7df7c345 ("firmware: arm_scpi: add support to populate OPPs and get transition latency")
>>
> nit: delete the blank line after the Fixes tag.
>
>> Signed-off-by: Felix Gu <gu_0233@qq.com>
> Did you find this issue just by reviewing the code? I read the comments
> and then looked at a sample of four other callers and none of them
> called of_node_put(). So it's a weird thing. If this is really the rule
> then we should have a static checker heuristic to enforce it.
>
> regards,
> dan carpenter
prev parent reply other threads:[~2026-01-19 18:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-16 12:54 Felix Gu
2026-01-16 13:36 ` Markus Elfring
2026-01-16 15:33 ` Sudeep Holla
2026-01-16 16:13 ` Markus Elfring
2026-01-18 12:58 ` Dan Carpenter
2026-01-18 19:15 ` [PATCH] " Dan Carpenter
2026-01-19 15:25 ` Sudeep Holla
2026-01-19 17:55 ` Felix Gu [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=tencent_C06105A21611283E4866B846091CE7B3CF06@qq.com \
--to=gu_0233@qq.com \
--cc=arm-scmi@vger.kernel.org \
--cc=cristian.marussi@arm.com \
--cc=dan.carpenter@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sudeep.holla@arm.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®