Commit 536eb97a authored by Wei Yongjun's avatar Wei Yongjun Committed by Viresh Kumar

cpufreq: qcom-hw: Fix return value check in qcom_cpufreq_hw_cpu_init()

In case of error, the function ioremap() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check
should be replaced with NULL test.

Fixes: 67fc209b ("cpufreq: qcom-hw: drop devm_xxx() calls from init/exit hooks")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Acked-by: default avatarShawn Guo <shawn.guo@linaro.org>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent 02fc4095
...@@ -317,9 +317,9 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy) ...@@ -317,9 +317,9 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy)
} }
base = ioremap(res->start, resource_size(res)); base = ioremap(res->start, resource_size(res));
if (IS_ERR(base)) { if (!base) {
dev_err(dev, "failed to map resource %pR\n", res); dev_err(dev, "failed to map resource %pR\n", res);
ret = PTR_ERR(base); ret = -ENOMEM;
goto release_region; goto release_region;
} }
......
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