]> git.hungrycats.org Git - linux/commit
cpufreq: Avoid a bad reference count on CPU node
authorMiquel Sabaté Solà <mikisabate@gmail.com>
Tue, 17 Sep 2024 13:42:46 +0000 (15:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Oct 2024 10:01:05 +0000 (12:01 +0200)
commit77f88b17387a017416babf1e6488fa17682287e2
treeceac051b1fc75e9d4bd8d4c88a38c768f7ad4721
parentbf0de0f9a0544c11f96f93206da04ab87dcea1f4
cpufreq: Avoid a bad reference count on CPU node

commit c0f02536fffbbec71aced36d52a765f8c4493dc2 upstream.

In the parse_perf_domain function, if the call to
of_parse_phandle_with_args returns an error, then the reference to the
CPU device node that was acquired at the start of the function would not
be properly decremented.

Address this by declaring the variable with the __free(device_node)
cleanup attribute.

Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Link: https://patch.msgid.link/20240917134246.584026-1-mikisabate@gmail.com
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/cpufreq.h