Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Wei Yongjun and committed by
Viresh Kumar
536eb97a 02fc4095

+2 -2
+2 -2
drivers/cpufreq/qcom-cpufreq-hw.c
··· 317 317 } 318 318 319 319 base = ioremap(res->start, resource_size(res)); 320 - if (IS_ERR(base)) { 320 + if (!base) { 321 321 dev_err(dev, "failed to map resource %pR\n", res); 322 - ret = PTR_ERR(base); 322 + ret = -ENOMEM; 323 323 goto release_region; 324 324 } 325 325