]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
leds: 88pm860x: add missing of_node_put
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sat, 24 Oct 2015 14:42:30 +0000 (16:42 +0200)
committerJacek Anaszewski <j.anaszewski@samsung.com>
Tue, 3 Nov 2015 08:00:06 +0000 (09:00 +0100)
commitffdc307d038f02617041f8e5c7e3cd00a1706a2a
treeb84ea75c62327c6f656994f4da5da045cb3cf721
parent6cc7624415466022749a868c159ac68367bc9a0e
leds: 88pm860x: add missing of_node_put

for_each_child_of_node performs an of_node_get on each iteration, so
a break out of the loop requires an of_node_put.

A simplified version of the semantic patch that fixes this problem is as
follows (http://coccinelle.lip6.fr):

// <smpl>
@@
local idexpression n;
expression e,r;
@@

 for_each_child_of_node(r,n) {
   ...
(
   of_node_put(n);
|
   e = n
|
+  of_node_put(n);
?  break;
)
   ...
 }
... when != n
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
drivers/leds/leds-88pm860x.c