From patchwork Tue Oct 13 00:29:40 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 35822 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 B8351B7E13 for ; Tue, 13 Oct 2009 11:29:47 +1100 (EST) Received: by ozlabs.org (Postfix) id 678EBB7B7D; Tue, 13 Oct 2009 11:29:42 +1100 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: from [127.0.0.1] (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 00F74B70B3; Tue, 13 Oct 2009 11:29:41 +1100 (EST) Subject: [Patch] powerpc: Fix memory leak in axon_msi.c From: Michael Ellerman To: linuxppc-dev list Date: Tue, 13 Oct 2009 11:29:40 +1100 Message-Id: <1255393780.9570.3.camel@concordia> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 Cc: eric.sesterhenn@lsexperts.de X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: michael@ellerman.id.au 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 cppcheck found a memory leak in axon_msi, if dcr_base or dcr_len are zero, we have already allocated msic, so we should free it in the error path. Signed-off-by: Eric Sesterhenn Acked-by: Michael Ellerman Acked-by: Arnd Bergmann --- linux/arch/powerpc/platforms/cell/axon_msi.c.orig 2009-10-12 14:48:26.000000000 +0200 +++ linux/arch/powerpc/platforms/cell/axon_msi.c 2009-10-12 14:48:52.000000000 +0200 @@ -365,7 +365,7 @@ static int axon_msi_probe(struct of_devi printk(KERN_ERR "axon_msi: couldn't parse dcr properties on %s\n", dn->full_name); - goto out; + goto out_free_msic; } msic->dcr_host = dcr_map(dn, dcr_base, dcr_len);