Skip to content

Commit

Permalink
powerpc/pmac/windfarm: Don't test pointers before kfree()
Browse files Browse the repository at this point in the history
Fix minor nits found by cppcheck

[./macintosh/windfarm_pm81.c:760]: (style) Redundant condition. It is safe to deallocate a NULL pointer
[./macintosh/windfarm_pm81.c:762]: (style) Redundant condition. It is safe to deallocate a NULL pointer

Signed-off-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
d binderman authored and Benjamin Herrenschmidt committed Apr 7, 2010
1 parent 213972e commit 6d1bdd2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/macintosh/windfarm_pm81.c
Original file line number Diff line number Diff line change
Expand Up @@ -757,10 +757,8 @@ static int __devexit wf_smu_remove(struct platform_device *ddev)
wf_put_control(cpufreq_clamp);

/* Destroy control loops state structures */
if (wf_smu_sys_fans)
kfree(wf_smu_sys_fans);
if (wf_smu_cpu_fans)
kfree(wf_smu_cpu_fans);
kfree(wf_smu_sys_fans);
kfree(wf_smu_cpu_fans);

return 0;
}
Expand Down

0 comments on commit 6d1bdd2

Please sign in to comment.