diff options
author | Chen Hui <judy.chenhui@huawei.com> | 2022-11-08 08:23:02 +0100 |
---|---|---|
committer | Viresh Kumar <viresh.kumar@linaro.org> | 2022-11-09 07:50:05 +0100 |
commit | 9901c21bcaf2f01fe5078f750d624f4ddfa8f81b (patch) | |
tree | 66bacf469c46b7032f14c8704f791a6895c9f129 /drivers/cpufreq/qcom-cpufreq-hw.c | |
parent | arm64: dts: ti: k3-am625-sk: Add 1.4GHz OPP (diff) | |
download | linux-9901c21bcaf2f01fe5078f750d624f4ddfa8f81b.tar.xz linux-9901c21bcaf2f01fe5078f750d624f4ddfa8f81b.zip |
cpufreq: qcom-hw: Fix memory leak in qcom_cpufreq_hw_read_lut()
If "cpu_dev" fails to get opp table in qcom_cpufreq_hw_read_lut(),
the program will return, resulting in "table" resource is not released.
Fixes: 51c843cf77bb ("cpufreq: qcom: Update the bandwidth levels on frequency change")
Signed-off-by: Chen Hui <judy.chenhui@huawei.com>
Reviewed-by: Sibi Sankar <quic_sibis@quicinc.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/cpufreq/qcom-cpufreq-hw.c')
-rw-r--r-- | drivers/cpufreq/qcom-cpufreq-hw.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c index 5e0598730a04..45dbb5d7fa77 100644 --- a/drivers/cpufreq/qcom-cpufreq-hw.c +++ b/drivers/cpufreq/qcom-cpufreq-hw.c @@ -197,6 +197,7 @@ static int qcom_cpufreq_hw_read_lut(struct device *cpu_dev, } } else if (ret != -ENODEV) { dev_err(cpu_dev, "Invalid opp table in device tree\n"); + kfree(table); return ret; } else { policy->fast_switch_possible = true; |