summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/qcom-cpufreq-hw.c
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2021-03-04 10:04:23 +0000
committerViresh Kumar <viresh.kumar@linaro.org>2021-03-08 16:20:07 +0530
commit536eb97abeba857126ad055de5923fa592acef25 (patch)
treeb64d701e05c2e3d6e1a2fded125f8f05cfd8f4cf /drivers/cpufreq/qcom-cpufreq-hw.c
parent02fc409540303801994d076fcdb7064bd634dbf3 (diff)
downloadlinux-536eb97abeba857126ad055de5923fa592acef25.tar.bz2
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: 67fc209b527d ("cpufreq: qcom-hw: drop devm_xxx() calls from init/exit hooks") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Shawn Guo <shawn.guo@linaro.org> 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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c
index bee5d67a8227..f86859bf76f1 100644
--- a/drivers/cpufreq/qcom-cpufreq-hw.c
+++ b/drivers/cpufreq/qcom-cpufreq-hw.c
@@ -317,9 +317,9 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy)
}
base = ioremap(res->start, resource_size(res));
- if (IS_ERR(base)) {
+ if (!base) {
dev_err(dev, "failed to map resource %pR\n", res);
- ret = PTR_ERR(base);
+ ret = -ENOMEM;
goto release_region;
}