From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: [Patch] powerpc: Fix memory leak in axon_msi.c From: Michael Ellerman To: linuxppc-dev list Content-Type: text/plain Date: Tue, 13 Oct 2009 11:29:40 +1100 Message-Id: <1255393780.9570.3.camel@concordia> Mime-Version: 1.0 Cc: eric.sesterhenn@lsexperts.de Reply-To: michael@ellerman.id.au List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 --- 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);