Commit 9901c21b authored by Chen Hui's avatar Chen Hui Committed by Viresh Kumar

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: 51c843cf ("cpufreq: qcom: Update the bandwidth levels on frequency change")
Signed-off-by: default avatarChen Hui <judy.chenhui@huawei.com>
Reviewed-by: default avatarSibi Sankar <quic_sibis@quicinc.com>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent 1313edfd
......@@ -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;
......
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