linux/arch/powerpc/platforms
Nicolas Palix 29e931c02b powerpc/chrp: Add missing of_node_put in pci.c
of_node_put is needed before discarding a value received from
of_find_node_by_name, eg in error handling code or when the device
node is no longer used.

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

// <smpl>
@r exists@
local idexpression struct device_node *n;
position p1, p2;
statement S1,S2;
expression E,E1;
expression *ptr != NULL;
@@

(
if (!(n@p1 = of_find_node_by_name(...))) S1
|
n@p1 = of_find_node_by_name(...)
)
<... when != of_node_put(n)
    when != if (...) { <+... of_node_put(n) ...+> }
    when != true !n  || ...
    when != n = E
    when != E = n
if (!n || ...) S2
...>
(
  return \(0\|<+...n...+>\|ptr\);
|
return@p2 ...;
|
n = E1
|
E1 = n
)
@script:python@
p1 << r.p1;
p2 << r.p2;
@@

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

Signed-off-by: Nicolas Palix <npalix@diku.dk>
Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-12-16 14:39:32 +11:00
..
8xx powerpc: Add support for the MPC852 based mgsuvd board from keymile. 2008-09-16 10:01:30 -05:00
40x powerpc/40x: Don't enable HCU4 board by default 2008-10-28 08:44:03 -04:00
44x powerpc/4xx: Add PowerPC 4xx GPIO driver 2008-10-17 13:33:44 -04:00
52xx powerpc/mpc5200: Don't touch pipelining for MPC5200B 2008-10-15 11:09:59 -06:00
82xx Merge commit 'origin' 2008-10-15 11:31:54 +11:00
83xx powerpc/83xx: don't probe broken PCI on mpc837x_mds boards 2008-10-13 11:09:58 -05:00
85xx powerpc/85xx: Don't reset the MPIC for CAMP mode on MPC8572DS 2008-12-03 10:51:01 -06:00
86xx powerpc/86xx: Basic GPIO support for GE Fanuc SBC610 2008-12-03 10:47:37 -06:00
512x powerpc/5121: Add PCI support. 2008-10-13 11:09:58 -05:00
cell Merge branch 'merge' into next 2008-12-16 14:38:58 +11:00
chrp powerpc/chrp: Add missing of_node_put in pci.c 2008-12-16 14:39:32 +11:00
embedded6xx powerpc: fix i2c on PPC linkstation / kurobox machines 2008-10-28 09:45:57 -05:00
iseries powerpc: Update remaining dma_mapping_ops to use map/unmap_page 2008-10-31 16:13:48 +11:00
maple Merge commit 'origin' 2008-10-15 11:31:54 +11:00
pasemi phylib: two dynamic mii_bus allocation fallout fixes 2008-10-09 09:45:04 -07:00
powermac powerpc/pmac: Use of_find_node_with_property() in pmac_setup_arch() 2008-11-19 16:05:03 +11:00
prep [POWERPC] Split several platforms into their respective Kconfig file 2007-03-22 10:07:32 -05:00
ps3 powerpc/ps3: Replace the flip_ctl logic in ps3av and ps3fb by a mutex 2008-11-19 16:03:54 +11:00
pseries powerpc/pci: Fix various pseries PCI hotplug issues 2008-11-06 09:31:52 +11:00
fsl_uli1575.c powerpc: Fix boot hang regression on MPC8544DS 2008-10-02 00:58:49 -05:00
Kconfig powerpc/QE: move QE_GPIO Kconfig symbol into the platforms/Kconfig 2008-10-13 11:09:58 -05:00
Kconfig.cputype Merge branch 'core-v28-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-10-16 15:17:40 -07:00
Makefile powerpc: Remove use of CONFIG_PPC_MERGE 2008-08-04 13:18:17 +10:00