MLK-20203-2 cpufreq: imx7ulp: fix coverity issue
This patch fixes coverity issue of "divide by 0". Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Bai Ping <ping.bai@nxp.com>pull/10/head
parent
90c0f2b1ba
commit
eb2d777665
|
@ -47,6 +47,8 @@ static int imx7ulp_set_target(struct cpufreq_policy *policy, unsigned int index)
|
|||
new_freq = freq_table[index].frequency;
|
||||
freq_hz = new_freq * 1000;
|
||||
old_freq = clk_get_rate(arm_clk) / 1000;
|
||||
if (new_freq == 0 || old_freq == 0)
|
||||
return -EINVAL;
|
||||
|
||||
opp = dev_pm_opp_find_freq_ceil(cpu_dev, &freq_hz);
|
||||
if (IS_ERR(opp)) {
|
||||
|
|
Loading…
Reference in New Issue