Skip to content

Commit f435236

Browse files
error27rafaeljw
authored andcommitted
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: 6286bbb ("cpufreq: apple-soc: Add new driver to control Apple SoC CPU P-states") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Eric Curtin <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 5bd289f commit f435236

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/cpufreq/apple-soc-cpufreq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ static int apple_soc_cpufreq_find_cluster(struct cpufreq_policy *policy,
189189
*info = match->data;
190190

191191
*reg_base = of_iomap(args.np, 0);
192-
if (IS_ERR(*reg_base))
193-
return PTR_ERR(*reg_base);
192+
if (!*reg_base)
193+
return -ENOMEM;
194194

195195
return 0;
196196
}

0 commit comments

Comments
 (0)