From patchwork Fri Mar 19 09:01:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: d binderman X-Patchwork-Id: 48122 X-Patchwork-Delegate: benh@kernel.crashing.org Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id B868CB7F6B for ; Fri, 19 Mar 2010 21:13:49 +1100 (EST) Received: by ozlabs.org (Postfix) id D6E42B7CB8; Fri, 19 Mar 2010 20:06:48 +1100 (EST) Delivered-To: linuxppc-dev@ozlabs.org X-Greylist: delayed 304 seconds by postgrey-1.32 at bilbo; Fri, 19 Mar 2010 20:06:48 EST Received: from blu0-omc3-s11.blu0.hotmail.com (blu0-omc3-s11.blu0.hotmail.com [65.55.116.86]) by ozlabs.org (Postfix) with ESMTP id 5BA7CB7CB6 for ; Fri, 19 Mar 2010 20:06:48 +1100 (EST) Received: from BLU108-W19 ([65.55.116.72]) by blu0-omc3-s11.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 19 Mar 2010 02:01:42 -0700 Message-ID: X-Originating-IP: [87.81.120.187] From: d binderman To: Subject: [PATCH]: Minor quibble in macintosh/windfarm_pm81.c Date: Fri, 19 Mar 2010 09:01:42 +0000 Importance: Normal MIME-Version: 1.0 X-OriginalArrivalTime: 19 Mar 2010 09:01:42.0675 (UTC) FILETIME=[CB575E30:01CAC742] X-Mailman-Approved-At: Fri, 19 Mar 2010 21:13:43 +1100 Cc: linuxppc-dev@ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Hello there, I just ran the sourceforge tool cppcheck over the source code of the new Linux kernel 2.6.34-rc1 It said [./macintosh/windfarm_pm81.c:760]: (style) Redundant condition. It is safe to deallocate a NULL poin ter [./macintosh/windfarm_pm81.c:762]: (style) Redundant condition. It is safe to deallocate a NULL poin ter The source code is         /* 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); Proposed patch file attached. Regards David Binderman Signed-off-by: David Binderman --- macintosh/windfarm_pm81.c.sav 2010-03-19 08:57:22.000000000 +0000 +++ macintosh/windfarm_pm81.c 2010-03-19 08:57:34.000000000 +0000 @@ -757,10 +757,8 @@ static int __devexit wf_smu_remove(struc 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; }