Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/pmac/windfarm: Don't test pointers before kfree()

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>

authored by

d binderman and committed by
Benjamin Herrenschmidt
6d1bdd2a 213972e9

+2 -4
+2 -4
drivers/macintosh/windfarm_pm81.c
··· 757 757 wf_put_control(cpufreq_clamp); 758 758 759 759 /* Destroy control loops state structures */ 760 - if (wf_smu_sys_fans) 761 - kfree(wf_smu_sys_fans); 762 - if (wf_smu_cpu_fans) 763 - kfree(wf_smu_cpu_fans); 760 + kfree(wf_smu_sys_fans); 761 + kfree(wf_smu_cpu_fans); 764 762 765 763 return 0; 766 764 }