]> www.infradead.org Git - users/jedix/linux-maple.git/commit
cpufreq: sun50i: fix memory leak in dt_has_supported_hw()
authorJavier Carrasco <javier.carrasco.cruz@gmail.com>
Fri, 3 May 2024 17:52:32 +0000 (19:52 +0200)
committerViresh Kumar <viresh.kumar@linaro.org>
Tue, 28 May 2024 04:01:08 +0000 (09:31 +0530)
commit6282fba6abd7c3c8896c239cc8aa9ec45edcb97b
tree8503ab828c07eb4a98d32ab9821ff6287557b1db
parent1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0
cpufreq: sun50i: fix memory leak in dt_has_supported_hw()

The for_each_child_of_node() loop does not decrement the child node
refcount before the break instruction, even though the node is no
longer required.

This can be avoided with the new for_each_child_of_node_scoped() macro
that removes the need for any of_node_put().

Fixes: fa5aec9561cf ("cpufreq: sun50i: Add support for opp_supported_hw")
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/sun50i-cpufreq-nvmem.c