From: Julia Lawall Date: Sat, 4 Sep 2010 07:13:17 +0000 (+0200) Subject: powerpc/5200: efika.c: Add of_node_put to avoid memory leak X-Git-Tag: v2.6.36-rc7~11^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=915b96191f01d53e30d74083dcf4aebfb5b7ce10;p=pandora-kernel.git powerpc/5200: efika.c: Add of_node_put to avoid memory leak This function is implemented as though the function of_get_next_child does not increment the reference count of its result, but actually it does. Thus the patch adds of_node_put in error handling code and drops a call to of_node_get. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r exists@ local idexpression x; expression E1; position p1,p2; @@ x@p1 = of_get_next_child(...); ... when != x = E1 of_node_get@p2(x) @script:python@ p1 << r.p1; p2 << r.p2; @@ cocci.print_main("call",p1) cocci.print_secs("get",p2) // Signed-off-by: Julia Lawall Signed-off-by: Grant Likely --- Reading git-diff-tree failed