summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2023-02-27 13:07:09 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2023-03-01 21:34:54 +0300
commitf43523620f646c89ffd8ada840a0068290e51266 (patch)
tree23f5dcbe4a2fe4d02b0690607cb61b61b37cb93e /drivers
parent5bd289f69bc145fa10927a6883502a0e7cbcb811 (diff)
downloadlinux-f43523620f646c89ffd8ada840a0068290e51266.tar.xz
cpufreq: apple-soc: Fix an IS_ERR() vs NULL check
The of_iomap() function returns NULL if it fails. It never returns error pointers. Fix the check accordingly. Fixes: 6286bbb40576 ("cpufreq: apple-soc: Add new driver to control Apple SoC CPU P-states") Signed-off-by: Dan Carpenter <error27@gmail.com> Reviewed-by: Eric Curtin <ecurtin@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/cpufreq/apple-soc-cpufreq.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/cpufreq/apple-soc-cpufreq.c b/drivers/cpufreq/apple-soc-cpufreq.c
index c11d22fd84c3..021f423705e1 100644
--- a/drivers/cpufreq/apple-soc-cpufreq.c
+++ b/drivers/cpufreq/apple-soc-cpufreq.c
@@ -189,8 +189,8 @@ static int apple_soc_cpufreq_find_cluster(struct cpufreq_policy *policy,
*info = match->data;
*reg_base = of_iomap(args.np, 0);
- if (IS_ERR(*reg_base))
- return PTR_ERR(*reg_base);
+ if (!*reg_base)
+ return -ENOMEM;
return 0;
}