Skip to contentSkip to conversation

powerpc: Fix memory leak in axon_msi.c

PATCH In review Michael Ellerman 2 participants 2 messages Oct 13, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: Fix memory leak in axon_msi.c

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.

arch/powerpc/platforms/cell/axon_msi.c renamed from arch/powerpc/platforms/cell/axon_msi.c.orig +1 -1
@@ -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);