summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/sti-cpufreq.c
diff options
context:
space:
mode:
authorYangtao Li <tiny.windzz@gmail.com>2020-10-12 16:01:41 +0200
committerViresh Kumar <viresh.kumar@linaro.org>2020-12-07 08:32:37 +0100
commit3a5e6732a74c44d7c78a764b9a7701135565df8f (patch)
tree4472ab733cebc0ee63448bd5ebebf57771cb2615 /drivers/cpufreq/sti-cpufreq.c
parentcpufreq: scmi: Fix build for !CONFIG_COMMON_CLK (diff)
downloadlinux-3a5e6732a74c44d7c78a764b9a7701135565df8f.tar.xz
linux-3a5e6732a74c44d7c78a764b9a7701135565df8f.zip
cpufreq: sti-cpufreq: fix mem leak in sti_cpufreq_set_opp_info()
Use dev_pm_opp_put_prop_name() to avoid mem leak, which free opp_table. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Signed-off-by: Yangtao Li <frank@allwinnertech.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/cpufreq/sti-cpufreq.c')
-rw-r--r--drivers/cpufreq/sti-cpufreq.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/cpufreq/sti-cpufreq.c b/drivers/cpufreq/sti-cpufreq.c
index 4ac6fb23792a..aab565edc4d3 100644
--- a/drivers/cpufreq/sti-cpufreq.c
+++ b/drivers/cpufreq/sti-cpufreq.c
@@ -223,7 +223,8 @@ use_defaults:
opp_table = dev_pm_opp_set_supported_hw(dev, version, VERSION_ELEMENTS);
if (IS_ERR(opp_table)) {
dev_err(dev, "Failed to set supported hardware\n");
- return PTR_ERR(opp_table);
+ ret = PTR_ERR(opp_table);
+ goto err_put_prop_name;
}
dev_dbg(dev, "pcode: %d major: %d minor: %d substrate: %d\n",
@@ -232,6 +233,10 @@ use_defaults:
version[0], version[1], version[2]);
return 0;
+
+err_put_prop_name:
+ dev_pm_opp_put_prop_name(opp_table);
+ return ret;
}
static int sti_cpufreq_fetch_syscon_registers(void)