Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=842decbd674106d63a67e07a2f8cec5af70fdb40
Commit:     842decbd674106d63a67e07a2f8cec5af70fdb40
Parent:     551ed332da2f52daf5d01fc76d2a894aba79d316
Author:     Julia Lawall <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 4 23:34:58 2008 -0800
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Wed Feb 6 22:06:59 2008 +1100

    [POWERPC] arch/powerpc/platforms/pseries: Add missing of_node_put
    
    Of_get_parent and of_find_compatible_node do an of_node_get, and thus a
    corresponding of_code_put is needed in the error 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 <[EMAIL PROTECTED]>
    Cc: Stephen Rothwell <[EMAIL PROTECTED]>
    Cc: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
    Cc: Kumar Gala <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/pseries/reconfig.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/reconfig.c 
b/arch/powerpc/platforms/pseries/reconfig.c
index c02f874..2800fce 100644
--- a/arch/powerpc/platforms/pseries/reconfig.c
+++ b/arch/powerpc/platforms/pseries/reconfig.c
@@ -167,6 +167,7 @@ static int pSeries_reconfig_remove_node(struct device_node 
*np)
 
        if ((child = of_get_next_child(np, NULL))) {
                of_node_put(child);
+               of_node_put(parent);
                return -EBUSY;
        }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to