]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
cpufreq: s5pv210: fix refcount leak
authorShuhao Fu <sfual@cse.ust.hk>
Sun, 5 Oct 2025 19:31:17 +0000 (03:31 +0800)
committerViresh Kumar <viresh.kumar@linaro.org>
Thu, 23 Oct 2025 06:40:11 +0000 (12:10 +0530)
commit2de5cb96060a1664880d65b120e59485a73588a8
tree6655a69a151464ec254fe2e47a494657e37df120
parent211ddde0823f1442e4ad052a2f30f050145ccada
cpufreq: s5pv210: fix refcount leak

In function `s5pv210_cpu_init`, a possible refcount inconsistency has
been identified, causing a resource leak.

Why it is a bug:
1. For every clk_get, there should be a matching clk_put on every
successive error handling path.
2. After calling `clk_get(dmc1_clk)`, variable `dmc1_clk` will not be
freed even if any error happens.

How it is fixed: For every failed path, an extra goto label is added to
ensure `dmc1_clk` will be freed regardlessly.

Signed-off-by: Shuhao Fu <sfual@cse.ust.hk>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/s5pv210-cpufreq.c