Skip to content
Commit d51e1062 authored by Jia-Wei Chang's avatar Jia-Wei Chang Committed by Viresh Kumar
Browse files

cpufreq: mediatek: fix KP caused by handler usage after regulator_put/clk_put



Any kind of failure in mtk_cpu_dvfs_info_init() will lead to calling
regulator_put() or clk_put() and the KP will occur since the regulator/clk
handlers are used after released in mtk_cpu_dvfs_info_release().

To prevent the usage after regulator_put()/clk_put(), the regulator/clk
handlers are addressed in a way of "Free the Last Thing Style".

Signed-off-by: default avatarJia-Wei Chang <jia-wei.chang@mediatek.com>
Fixes: 4b9ceb75

 ("cpufreq: mediatek: Enable clocks and regulators")
Suggested-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Suggested-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent d51c6323
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