Skip to content

Commit efb2d3b

Browse files
elfringrafaeljw
authored andcommitted
cpufreq: CPPC: Delete an unnecessary check before the function call kfree()
The kfree() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent ad806ea commit efb2d3b

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/cpufreq/cppc_cpufreq.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,7 @@ static int __init cppc_cpufreq_init(void)
166166

167167
out:
168168
for_each_possible_cpu(i)
169-
if (all_cpu_data[i])
170-
kfree(all_cpu_data[i]);
169+
kfree(all_cpu_data[i]);
171170

172171
kfree(all_cpu_data);
173172
return -ENODEV;

0 commit comments

Comments
 (0)