Skip to content

Commit

Permalink
cpufreq: CPPC: Delete an unnecessary check before the function call k…
Browse files Browse the repository at this point in the history
…free()

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>
  • Loading branch information
Markus Elfring authored and Rafael J. Wysocki committed Nov 6, 2015
1 parent ad806ea commit efb2d3b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/cpufreq/cppc_cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ static int __init cppc_cpufreq_init(void)

out:
for_each_possible_cpu(i)
if (all_cpu_data[i])
kfree(all_cpu_data[i]);
kfree(all_cpu_data[i]);

kfree(all_cpu_data);
return -ENODEV;
Expand Down

0 comments on commit efb2d3b

Please sign in to comment.