kernel-hacking-2024-linux-s.../arch/powerpc/platforms/cell
Julia Lawall 182f30e4b9 powerpc/cell: Add of_node_put to avoid memory leak
Add calls to of_node_put in the error handling code following calls to
of_find_node_by_path and of_find_node_by_phandle.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
local idexpression x;
expression E,E1;
statement S;
@@

*x =
(of_find_node_by_path
|of_find_node_by_name
|of_find_node_by_phandle
|of_get_parent
|of_get_next_parent
|of_get_next_child
|of_find_compatible_node
|of_match_node
)(...);
...
if (x == NULL) S
<... when != x = E
*if (...) {
  ... when != of_node_put(x)
      when != if (...) { ... of_node_put(x); ... }
(
  return <+...x...+>;
|
*  return ...;
)
}
...>
of_node_put(x);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2010-09-02 14:07:33 +10:00
..
spufs spufs conversion to ->evict_inode() 2010-08-09 16:48:02 -04:00
axon_msi.c powerpc: remove references to of_device and to_of_device 2010-07-24 09:58:21 -06:00
beat.c
beat.h
beat_htab.c powerpc: Convert beat_htab_lock to raw_spinlock 2010-02-19 14:52:31 +11:00
beat_hvCall.S
beat_interrupt.c powerpc: Convert beatic_irq_mask_lock to raw_spinlock 2010-02-19 14:52:30 +11:00
beat_interrupt.h
beat_iommu.c of: Merge of_platform_bus_type with platform_bus_type 2010-07-24 09:57:51 -06:00
beat_smp.c
beat_spu_priv1.c
beat_syscall.h
beat_udbg.c
beat_wrapper.h
cbe_cpufreq.c powerpc/cpumask: Dynamically allocate cpu_sibling_map and cpu_core_map cpumasks 2010-05-06 17:41:56 +10:00
cbe_cpufreq.h
cbe_cpufreq_pervasive.c
cbe_cpufreq_pmi.c
cbe_powerbutton.c of: add 'of_' prefix to machine_is_compatible() 2010-02-09 08:33:00 -07:00
cbe_regs.c
cbe_thermal.c
celleb_pci.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
celleb_pci.h
celleb_scc.h
celleb_scc_epci.c
celleb_scc_pciex.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
celleb_scc_sio.c
celleb_scc_uhc.c
celleb_setup.c powerpc/cell: Replace strncpy by strlcpy 2009-08-20 10:12:29 +10:00
cpufreq_spudemand.c
interrupt.c powerpc: Remove whitespace in irq chip name fields 2010-02-17 14:02:48 +11:00
interrupt.h
io-workarounds.c
io-workarounds.h
iommu.c powerpc: Fix bogus it_blocksize in VIO iommu code 2010-08-24 15:26:31 +10:00
Kconfig powerpc/sputrace: Use the generic event tracer 2009-08-20 10:29:21 +10:00
Makefile
pervasive.c
pervasive.h
pmu.c
qpace_setup.c of: remove of_default_bus_ids 2010-07-24 09:58:22 -06:00
ras.c powerpc/cell: Add of_node_put to avoid memory leak 2010-09-02 14:07:33 +10:00
ras.h
setup.c of: remove of_default_bus_ids 2010-07-24 09:58:22 -06:00
smp.c powerpc: Move definitions of secondary CPU spinloop to header file 2009-08-20 10:12:44 +10:00
spider-pci.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
spider-pic.c powerpc/cell: Add of_node_put to avoid memory leak 2010-09-02 14:07:33 +10:00
spu_base.c fbdev: move logo externs to header file 2009-06-16 19:47:57 -07:00
spu_callbacks.c
spu_fault.c Move FAULT_FLAG_xyz into handle_mm_fault() callers 2009-06-21 13:08:22 -07:00
spu_manage.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
spu_notify.c
spu_priv1_mmio.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
spu_priv1_mmio.h
spu_syscalls.c