Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=af449c330eb39ae57b139832181d0dcf3b94d806
Commit:     af449c330eb39ae57b139832181d0dcf3b94d806
Parent:     bd4c2edc90c020ba5573da5dbd796fd6ab78692b
Author:     Julia Lawall <[EMAIL PROTECTED]>
AuthorDate: Thu Dec 13 15:56:15 2007 -0800
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Thu Dec 20 17:13:51 2007 +1100

    [POWERPC] arch/powerpc: Add missing of_node_put
    
    There should be an of_node_put when breaking out of a loop that iterates
    over calls to of_find_all_nodes, as this function does an of_node_get on
    the value it returns.
    
    This was fixed using the following semantic patch.
    (http://www.emn.fr/x-info/coccinelle/)
    
    // <smpl>
    @@
    type T;
    identifier d;
    expression e;
    @@
    
    T *d;
    ...
    for (d = NULL; (d = of_find_all_nodes(d)) != NULL; )
     {... when != of_node_put(d)
          when != e = d
    (
       return d;
    |
    +  of_node_put(d);
    ?  return ...;
    )
    ...}
    // </smpl>
    
    Signed-off-by: Julia Lawall <[EMAIL PROTECTED]>
    Cc: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/iseries/iommu.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/platforms/iseries/iommu.c 
b/arch/powerpc/platforms/iseries/iommu.c
index 49e9c66..6a0c6f6 100644
--- a/arch/powerpc/platforms/iseries/iommu.c
+++ b/arch/powerpc/platforms/iseries/iommu.c
@@ -163,8 +163,10 @@ static struct iommu_table *iommu_table_find(struct 
iommu_table * tbl)
                    (it->it_type == TCE_PCI) &&
                    (it->it_offset == tbl->it_offset) &&
                    (it->it_index == tbl->it_index) &&
-                   (it->it_size == tbl->it_size))
+                   (it->it_size == tbl->it_size)) {
+                       of_node_put(node);
                        return it;
+               }
        }
        return NULL;
 }
-
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