powerpc: Fix memory leak in axon_msi.c
Subsystems (2)
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.
Signed-off-by Eric Sesterhenn <[email protected]>
Acked-by Michael Ellerman <[email protected]>
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_deviprintk (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);
Quoted 5 lines · Michael Ellerman
cppcheck found a memory leak in
axon_msi, ifdcr_baseordcr_lenare zero, we have already allocated msic, so we should free it in the error path.Signed-off-by Eric Sesterhenn <[email protected]>Acked-by Michael Ellerman <[email protected]>
Acked-by Arnd Bergmann <[email protected]>