]> git.baikalelectronics.ru Git - kernel.git/commit
gpu: host1x: bus: Add missing of_node_put()
authorAmitoj Kaur Chawla <amitoj1606@gmail.com>
Sun, 24 Jan 2016 16:32:10 +0000 (22:02 +0530)
committerThierry Reding <treding@nvidia.com>
Wed, 16 Mar 2016 12:45:43 +0000 (13:45 +0100)
commit269e848f73560c66b6d9e0d9ecc9a8363ec348ea
tree8f6f78ef86cdafd34ed27641a612c80dc2d16270
parentd7e15052ecc9ac4f938d1d7432c1d120a2711a7e
gpu: host1x: bus: Add missing of_node_put()

for_each_child_of_node() performs an of_node_get() on each iteration, so
to break out of the loop an of_node_put() is required.

Found using Coccinelle. The semantic patch used for this is as follows:

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

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

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/host1x/bus.c