Commit 3a5e6732 authored by Yangtao Li's avatar Yangtao Li Committed by Viresh Kumar

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: default avatarYangtao Li <tiny.windzz@gmail.com>
Signed-off-by: default avatarYangtao Li <frank@allwinnertech.com>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent f943849f
......@@ -223,7 +223,8 @@ static int sti_cpufreq_set_opp_info(void)
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 @@ static int sti_cpufreq_set_opp_info(void)
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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment