linux_dsm_epyc7002/arch/powerpc/platforms/82xx
Julia Lawall 75e89b02e3 [POWERPC] arch/powerpc/platforms/82xx: Add missing of_node_put
Of_get_parent and of_find_compatible_node do a of_node_get, and thus a
corresponding of_code_put is needed in both the error case and the normal
return case.

The problem was found using the following semantic match.
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
type T,T1,T2;
identifier E;
statement S;
expression x1,x2,x3;
int ret;
@@

  T E;
  ...
* E = \(of_get_parent\|of_find_compatible_node\)(...);
  if (E == NULL) S
  ... when != of_node_put(...,(T1)E,...)
      when != if (E != NULL) { ... of_node_put(...,(T1)E,...); ...}
      when != x1 = (T1)E
      when != E = x3;
      when any
  if (...) {
    ... when != of_node_put(...,(T2)E,...)
        when != if (E != NULL) { ... of_node_put(...,(T2)E,...); ...}
        when != x2 = (T2)E
(
*   return;
|
*   return ret;
)
  }
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Kumar Gala <galak@gate.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-02-06 22:06:59 +11:00
..
ep8248e.c [POWERPC] 82xx: Embedded Planet EP8248E support 2008-01-23 19:34:43 -06:00
Kconfig [POWERPC] 82xx: Embedded Planet EP8248E support 2008-01-23 19:34:43 -06:00
m82xx_pci.h [POWERPC] Remove old includes from arch/ppc 2007-08-22 22:39:35 -05:00
Makefile [POWERPC] 82xx: Embedded Planet EP8248E support 2008-01-23 19:34:43 -06:00
mpc8272_ads.c [POWERPC] arch/powerpc/platforms/82xx: Add missing of_node_put 2008-02-06 22:06:59 +11:00
pq2.c [POWERPC] pci32: Add flags modifying the PCI code behaviour 2007-12-20 16:18:07 +11:00
pq2.h [POWERPC] mpc82xx: Update mpc8272ads, and factor out PCI and reset. 2007-10-04 11:02:44 -05:00
pq2ads-pci-pic.c [POWERPC] mpc82xx: Update mpc8272ads, and factor out PCI and reset. 2007-10-04 11:02:44 -05:00
pq2ads.h [POWERPC] mpc82xx: Update mpc8272ads, and factor out PCI and reset. 2007-10-04 11:02:44 -05:00
pq2fads.c [POWERPC] arch/powerpc/platforms/82xx: Add missing of_node_put 2008-02-06 22:06:59 +11:00