Эх сурвалжийг харах

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>
d binderman 15 жил өмнө
parent
commit
6d1bdd2afb

+ 2 - 4
drivers/macintosh/windfarm_pm81.c

@@ -757,10 +757,8 @@ static int __devexit wf_smu_remove(struct platform_device *ddev)
 		wf_put_control(cpufreq_clamp);
 		wf_put_control(cpufreq_clamp);
 
 
 	/* Destroy control loops state structures */
 	/* 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;
 	return 0;
 }
 }