Thread (8 messages) 8 messages, 4 authors, 2026-01-19

Re: [PATCH] firmware: arm_scpi: Fix a reference leak on device node

From: Sudeep Holla <hidden>
Date: 2026-01-19 15:25:25
Also in: arm-scmi, lkml

On Sun, Jan 18, 2026 at 10:15:37PM +0300, Dan Carpenter wrote:
On Fri, Jan 16, 2026 at 08:54:39PM +0800, Felix Gu wrote:
quoted
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.
quoted
Signed-off-by: Felix Gu <redacted>
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.
I agree. I see bit of inconsistency at call sites especially in SC{P,M}I
related modules I maintain. It seem to me based on the description at
of_parse_phandle_with_args() definition and various other call sites as
examples, we need to have of_node_put(). That said, I don't have any easier
way to validate these, so I am happy for any reviews and recommendations.

-- 
Regards,
Sudeep
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help