linux-stable/arch/powerpc/sysdev
Julia Lawall 7a626b66bb powerpc/ipic: introduce missing kfree
Error handling code following a kzalloc should free the allocated data.

The semantic match that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r exists@
local idexpression x;
statement S;
expression E;
identifier f,f1,l;
position p1,p2;
expression *ptr != NULL;
@@

x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
...
if (x == NULL) S
<... when != x
     when != if (...) { <+...x...+> }
(
x->f1 = E
|
 (x->f1 == NULL || ...)
|
 f(...,x->f1,...)
)
...>
(
 return \(0\|<+...x...+>\|ptr\);
|
 return@p2 ...;
)

@script:python@
p1 << r.p1;
p2 << r.p2;
@@

print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-08-20 10:27:34 +10:00
..
bestcomm
qe_lib powerpc: Don't use alloc_bootmem() in init_IRQ() path 2009-07-08 13:50:25 +10:00
6xx-suspend.S
axonram.c block: Do away with the notion of hardsect_size 2009-05-22 23:22:54 +02:00
cpm1.c
cpm2.c powerpc/cpm: Remove some cruft code and defines 2009-05-19 00:47:19 -05:00
cpm2_pic.c
cpm2_pic.h
cpm_common.c
dart.h
dart_iommu.c
dcr-low.S
dcr.c
fsl_gtm.c
fsl_lbc.c
fsl_msi.c powerpc/fsl: Support unique MSI addresses per PCIe Root Complex 2009-05-19 00:50:38 -05:00
fsl_msi.h
fsl_pci.c powerpc/pci: Clean up direct access to sysdata by FSL platforms 2009-05-21 15:44:22 +10:00
fsl_pci.h powerpc/fsl: Setup PCI inbound window based on actual amount of memory 2009-05-19 00:50:44 -05:00
fsl_rio.c powerpc/fsl_rio: Add kmalloc NULL tests 2009-08-20 10:27:17 +10:00
fsl_soc.c powerpc/fsl: use of_iomap() for rstcr mapping 2009-05-19 00:46:18 -05:00
fsl_soc.h
grackle.c
i8259.c
indirect_pci.c powerpc/pci: Clean up direct access to sysdata by indirect ops 2009-05-21 15:44:22 +10:00
ipic.c powerpc/ipic: introduce missing kfree 2009-08-20 10:27:34 +10:00
ipic.h
Kconfig
Makefile powerpc/5xxx: Add common mpc5xxx_get_bus_frequency() function 2009-06-17 00:30:22 -06:00
micropatch.c
mmio_nvram.c
mpc5xxx_clocks.c powerpc/5xxx: Add common mpc5xxx_get_bus_frequency() function 2009-06-17 00:30:22 -06:00
mpc8xx_pic.c
mpc8xx_pic.h
mpc8xxx_gpio.c
mpic.c powerpc/mpic: Fix MPIC_BROKEN_REGREAD on non broken MPICs 2009-08-20 10:12:22 +10:00
mpic.h irq: change ->set_affinity() to return status, fix 2009-05-06 07:55:33 +02:00
mpic_msi.c
mpic_pasemi_msi.c
mpic_u3msi.c
msi_bitmap.c
mv64x60.h
mv64x60_dev.c
mv64x60_pci.c
mv64x60_pic.c
mv64x60_udbg.c
of_rtc.c
pmi.c
ppc4xx_gpio.c
ppc4xx_pci.c powerpc: Remove unnecessary semicolons 2009-07-08 13:50:21 +10:00
ppc4xx_pci.h
ppc4xx_soc.c
rtc_cmos_setup.c
simple_gpio.c
simple_gpio.h
tsi108_dev.c
tsi108_pci.c powerpc/pci: Clean up direct access to sysdata on tsi108 platforms 2009-05-21 15:44:23 +10:00
uic.c powerpc: Don't use alloc_bootmem() in init_IRQ() path 2009-07-08 13:50:25 +10:00
xilinx_intc.c powerpc/virtex: Add Xilinx ML510 reference design support 2009-06-06 10:15:24 -06:00
xilinx_pci.c powerpc/virtex: Add support for Xilinx PCI host bridge 2009-06-06 10:14:22 -06:00