drivers/serial/uartlite.c: Add missing of_node_put

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git-commits-head@...>
Date: Tuesday, December 11, 2007 - 1:59 am

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=76832d...
Commit:     76832d8416430d6dd0575579ca1e00d1a790f4cb
Parent:     72fad7139b6829f71d7f41f39eb30da5760d90a8
Author:     Julia Lawall <julia@diku.dk>
AuthorDate: Mon Dec 10 15:49:28 2007 -0800
Committer:  Linus Torvalds <torvalds@woody.linux-foundation.org>
CommitDate: Mon Dec 10 19:43:55 2007 -0800

    drivers/serial/uartlite.c: Add missing of_node_put
    
    There should be an of_node_put when breaking out of a loop that iterates
    using for_each_compatible_node.
    
    This was detected and fixed using the following semantic patch.
    (http://www.emn.fr/x-info/coccinelle/)
    
    // <smpl>
    @@
    identifier d;
    type T;
    expression e;
    iterator for_each_compatible_node;
    @@
    
    T *d;
    ...
    for_each_compatible_node(d,...)
      {... when != of_node_put(d)
           when != e = d
    (
       return d;
    |
    +  of_node_put(d);
    ?  return ...;
    )
    ...}
    // </smpl>
    
    Signed-off-by: Julia Lawall <julia@diku.dk>
    Acked-by: Grant Likely <grant.likely@secretlab.ca>
    Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
 drivers/serial/uartlite.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
index a85f2d3..3f59324 100644
--- a/drivers/serial/uartlite.c
+++ b/drivers/serial/uartlite.c
@@ -393,6 +393,7 @@ static inline void __init ulite_console_of_find_device(int id)
 			continue;
 
 		ulite_ports[id].mapbase = res.start;
+		of_node_put(np);
 		return;
 	}
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
drivers/serial/uartlite.c: Add missing of_node_put, Linux Kernel Mailing List..., (Tue Dec 11, 1:59 am)