]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
cpufreq: scmi: Fix device_node reference leak in scmi_cpu_domain_id()
authorFelix Gu <ustc.gu@gmail.com>
Wed, 21 Jan 2026 15:32:06 +0000 (23:32 +0800)
committerViresh Kumar <viresh.kumar@linaro.org>
Tue, 27 Jan 2026 05:51:24 +0000 (11:21 +0530)
When calling of_parse_phandle_with_args(), the caller is responsible
to call of_node_put() to release the reference of device node.
In scmi_cpu_domain_id(), it does not release the reference.

Fixes: e336baa4193e ("cpufreq: scmi: Prepare to move OF parsing of domain-id to cpufreq")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/scmi-cpufreq.c

index e0e1756180b0c82be1453956f0a726b9dd4e7384..c7a3b038385b5e0bdc4e63af505eeba0f67c48c7 100644 (file)
@@ -101,6 +101,7 @@ static int scmi_cpu_domain_id(struct device *cpu_dev)
                        return -EINVAL;
        }
 
+       of_node_put(domain_id.np);
        return domain_id.args[0];
 }