leds: tlc591xx: add missing of_node_put
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sat, 15 Jul 2017 09:58:19 +0000 (11:58 +0200)
committerJacek Anaszewski <jacek.anaszewski@gmail.com>
Sun, 16 Jul 2017 16:45:43 +0000 (18:45 +0200)
commitc68729119f4d2993bec3c9cb999ad76de5aeddba
treeb1713aa8c04b372cce31504f707bf7565647b41f
parent1055790b0df7202e363a55817688e3edbe1498a4
leds: tlc591xx: add missing of_node_put

for_each_child_of_node performs an of_node_get on each iteration, so a
return from the loop requires an of_node_put.

The semantic patch that fixes this problem is as follows
(http://coccinelle.lip6.fr):

// <smpl>
@@
local idexpression n;
expression e,e1;
iterator name for_each_child_of_node;
@@

 for_each_child_of_node(e1,n) {
   ...
(
   of_node_put(n);
|
   e = n
|
   return n;
|
+  of_node_put(n);
?  return ...;
)
   ...
 }
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
drivers/leds/leds-tlc591xx.c